1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

fix private ptt.

This commit is contained in:
Mrs4s 2020-10-16 11:33:22 +08:00
parent 626e23d99c
commit 0922b058ff
2 changed files with 12 additions and 0 deletions

View File

@ -593,12 +593,20 @@ func (c *QQClient) buildGroupSendingPacket(groupCode int64, r, pkgNum, pkgIndex,
// MessageSvc.PbSendMsg
func (c *QQClient) buildFriendSendingPacket(target int64, msgSeq, r, pkgNum, pkgIndex, pkgDiv int32, time int64, m []message.IMessageElement) (uint16, []byte) {
seq := c.nextSeq()
var ptt *msg.Ptt
if len(m) > 0 {
if p, ok := m[0].(*message.PrivateVoiceElement); ok {
ptt = p.Ptt
m = []message.IMessageElement{}
}
}
req := &msg.SendMessageRequest{
RoutingHead: &msg.RoutingHead{C2C: &msg.C2C{ToUin: target}},
ContentHead: &msg.ContentHead{PkgNum: pkgNum, PkgIndex: pkgIndex, DivSeq: pkgDiv},
MsgBody: &msg.MessageBody{
RichText: &msg.RichText{
Elems: message.ToProtoElems(m, false),
Ptt: ptt,
},
},
MsgSeq: msgSeq,

View File

@ -272,6 +272,10 @@ func (e *GroupVoiceElement) Type() ElementType {
return Voice
}
func (e *PrivateVoiceElement) Type() ElementType {
return Voice
}
func (e *VoiceElement) Type() ElementType {
return Voice
}