MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / ParseGroupMessage

Function ParseGroupMessage

message/message.go:114–136  ·  view source on GitHub ↗
(msg *message.PushMsgBody)

Source from the content-addressed store, hash-verified

112}
113
114func ParseGroupMessage(msg *message.PushMsgBody) *GroupMessage {
115 grpMsg := &GroupMessage{
116 ID: msg.ContentHead.Sequence.Unwrap(),
117 InternalID: msg.ContentHead.MsgId.Unwrap(),
118 GroupUin: msg.ResponseHead.Grp.GroupUin,
119 GroupName: msg.ResponseHead.Grp.GroupName,
120 Sender: &Sender{
121 Uin: msg.ResponseHead.FromUin,
122 UID: msg.ResponseHead.FromUid.Unwrap(),
123 Nickname: msg.ResponseHead.Grp.MemberName,
124 CardName: msg.ResponseHead.Grp.MemberName,
125 IsFriend: false,
126 },
127 Time: msg.ContentHead.TimeStamp.Unwrap(),
128
129 OriginalObject: msg,
130 }
131 if msg.Body != nil {
132 grpMsg.Elements = ParseMessageElements(msg.Body.RichText.Elems)
133 grpMsg.Elements = append(grpMsg.Elements, ParseMessageBody(msg.Body, true)...)
134 }
135 return grpMsg
136}
137
138func ParseTempMessage(msg *message.PushMsgBody) *TempMessage {
139 return &TempMessage{

Callers

nothing calls this directly

Calls 2

ParseMessageElementsFunction · 0.85
ParseMessageBodyFunction · 0.85

Tested by

no test coverage detected