mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
添加json 消息的支持
This commit is contained in:
parent
71595a2567
commit
9c48d0907b
@ -347,6 +347,15 @@ func ToProtoElems(elems []IMessageElement, generalFlags bool) (r []*msg.Elem) {
|
|||||||
})
|
})
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if e.SubType == "json" {
|
||||||
|
r = append(r,&msg.Elem{
|
||||||
|
LightApp:&msg.LightAppElem{
|
||||||
|
Data:append([]byte{1}, binary.ZlibCompress([]byte(e.Content))...),
|
||||||
|
MsgResid: []byte{1},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
continue
|
||||||
|
}
|
||||||
r = append(r, &msg.Elem{
|
r = append(r, &msg.Elem{
|
||||||
RichMsg: &msg.RichMsg{
|
RichMsg: &msg.RichMsg{
|
||||||
Template1: append([]byte{1}, binary.ZlibCompress([]byte(e.Content))...),
|
Template1: append([]byte{1}, binary.ZlibCompress([]byte(e.Content))...),
|
||||||
@ -539,7 +548,7 @@ func (forMsg *ForwardMessage) CalculateValidationData(seq, random int32, groupCo
|
|||||||
FromUin: node.SenderId,
|
FromUin: node.SenderId,
|
||||||
MsgSeq: seq,
|
MsgSeq: seq,
|
||||||
MsgTime: node.Time,
|
MsgTime: node.Time,
|
||||||
MsgUid: 0x01000000000000000 | (int64(random) & 0xFFFF_FFFF),
|
MsgUid: 0x01000000000000000 | (int64(random) & 0xFFFFFFFF),
|
||||||
MutiltransHead: &msg.MutilTransHead{
|
MutiltransHead: &msg.MutilTransHead{
|
||||||
MsgId: 1,
|
MsgId: 1,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user