mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
commit
592ca2358f
@ -15,6 +15,7 @@ import (
|
|||||||
|
|
||||||
"github.com/Mrs4s/MiraiGo/client/internal/highway"
|
"github.com/Mrs4s/MiraiGo/client/internal/highway"
|
||||||
"github.com/Mrs4s/MiraiGo/client/internal/network"
|
"github.com/Mrs4s/MiraiGo/client/internal/network"
|
||||||
|
"github.com/Mrs4s/MiraiGo/client/pb/cmd0x388"
|
||||||
"github.com/Mrs4s/MiraiGo/client/pb/longmsg"
|
"github.com/Mrs4s/MiraiGo/client/pb/longmsg"
|
||||||
"github.com/Mrs4s/MiraiGo/client/pb/msg"
|
"github.com/Mrs4s/MiraiGo/client/pb/msg"
|
||||||
"github.com/Mrs4s/MiraiGo/client/pb/multimsg"
|
"github.com/Mrs4s/MiraiGo/client/pb/multimsg"
|
||||||
@ -512,12 +513,44 @@ func (c *QQClient) parseGroupMessage(m *msg.Message) *message.GroupMessage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if m.Body.RichText.Ptt != nil {
|
if m.Body.RichText.Ptt != nil {
|
||||||
|
var url string
|
||||||
|
if len(m.Body.RichText.Ptt.DownPara) == 0 {
|
||||||
|
req := &cmd0x388.D388ReqBody{
|
||||||
|
NetType: proto.Uint32(3),
|
||||||
|
Subcmd: proto.Uint32(4),
|
||||||
|
GetpttUrlReq: []*cmd0x388.GetPttUrlReq{
|
||||||
|
{
|
||||||
|
GroupCode: proto.Uint64(uint64(m.Head.GroupInfo.GroupCode.Unwrap())),
|
||||||
|
DstUin: proto.Uint64(uint64(m.Head.ToUin.Unwrap())),
|
||||||
|
Fileid: proto.Uint64(uint64(m.Body.RichText.Ptt.FileId.Unwrap())),
|
||||||
|
FileMd5: m.Body.RichText.Ptt.FileMd5,
|
||||||
|
ReqTerm: proto.Uint32(5),
|
||||||
|
ReqPlatformType: proto.Uint32(9),
|
||||||
|
InnerIp: proto.Uint32(0),
|
||||||
|
BuType: proto.Uint32(3),
|
||||||
|
FileId: proto.Uint64(0),
|
||||||
|
FileKey: m.Body.RichText.Ptt.FileKey,
|
||||||
|
ReqTransferType: proto.Uint32(2),
|
||||||
|
IsAuto: proto.Uint32(1),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
payload, _ := proto.Marshal(req)
|
||||||
|
rsp_raw, _ := c.sendAndWaitDynamic(c.uniPacket("PttStore.GroupPttDown", payload))
|
||||||
|
rsp := new(cmd0x388.D388RspBody)
|
||||||
|
proto.Unmarshal(rsp_raw, rsp)
|
||||||
|
resp := rsp.GetpttUrlRsp[0]
|
||||||
|
url = "http://" + string(resp.DownDomain) + string(resp.DownPara)
|
||||||
|
} else {
|
||||||
|
url = "http://grouptalk.c2c.qq.com" + string(m.Body.RichText.Ptt.DownPara)
|
||||||
|
}
|
||||||
|
|
||||||
g.Elements = []message.IMessageElement{
|
g.Elements = []message.IMessageElement{
|
||||||
&message.VoiceElement{
|
&message.VoiceElement{
|
||||||
Name: m.Body.RichText.Ptt.FileName.Unwrap(),
|
Name: m.Body.RichText.Ptt.FileName.Unwrap(),
|
||||||
Md5: m.Body.RichText.Ptt.FileMd5,
|
Md5: m.Body.RichText.Ptt.FileMd5,
|
||||||
Size: m.Body.RichText.Ptt.FileSize.Unwrap(),
|
Size: m.Body.RichText.Ptt.FileSize.Unwrap(),
|
||||||
Url: "http://grouptalk.c2c.qq.com" + string(m.Body.RichText.Ptt.DownPara),
|
Url: url,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user