mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
feature friend ptt decode.
This commit is contained in:
parent
03652b0425
commit
37b3821668
@ -328,7 +328,7 @@ func decodeMessageSvcPacket(c *QQClient, _ uint16, payload []byte) (interface{},
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
c.dispatchTempMessage(c.parseTempMessage(message))
|
c.dispatchTempMessage(c.parseTempMessage(message))
|
||||||
case 166: // 好友消息
|
case 166, 208: // 好友消息
|
||||||
if message.Head.GetFromUin() == c.Uin {
|
if message.Head.GetFromUin() == c.Uin {
|
||||||
for {
|
for {
|
||||||
frdSeq := atomic.LoadInt32(&c.friendSeq)
|
frdSeq := atomic.LoadInt32(&c.friendSeq)
|
||||||
|
@ -371,7 +371,19 @@ func (c *QQClient) parsePrivateMessage(msg *msg.Message) *message.PrivateMessage
|
|||||||
Target: c.Uin,
|
Target: c.Uin,
|
||||||
Time: msg.Head.GetMsgTime(),
|
Time: msg.Head.GetMsgTime(),
|
||||||
Sender: sender,
|
Sender: sender,
|
||||||
Elements: message.ParseMessageElems(msg.Body.RichText.Elems),
|
Elements: func() []message.IMessageElement {
|
||||||
|
if msg.Body.RichText.Ptt != nil {
|
||||||
|
return []message.IMessageElement{
|
||||||
|
&message.VoiceElement{
|
||||||
|
Name: msg.Body.RichText.Ptt.GetFileName(),
|
||||||
|
Md5: msg.Body.RichText.Ptt.FileMd5,
|
||||||
|
Size: msg.Body.RichText.Ptt.GetFileSize(),
|
||||||
|
Url: string(msg.Body.RichText.Ptt.DownPara),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message.ParseMessageElems(msg.Body.RichText.Elems)
|
||||||
|
}(),
|
||||||
}
|
}
|
||||||
if msg.Body.RichText.Attr != nil {
|
if msg.Body.RichText.Attr != nil {
|
||||||
ret.InternalId = msg.Body.RichText.Attr.GetRandom()
|
ret.InternalId = msg.Body.RichText.Attr.GetRandom()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user