1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00
This commit is contained in:
Sam 2021-03-11 16:55:13 +08:00
parent cef9c9ddee
commit e80b770481
2 changed files with 6 additions and 0 deletions

View File

@ -38,6 +38,9 @@ func GZipCompress(data []byte) []byte {
}
func GZipUncompress(src []byte) []byte {
if src == nil {
return nil
}
b := bytes.NewReader(src)
var out bytes.Buffer
r, _ := gzip.NewReader(b)

View File

@ -120,6 +120,9 @@ func decodeMultiApplyDownResponse(_ *QQClient, _ *incomingPacketInfo, payload []
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
}
uc := binary.GZipUncompress(lb.MsgDownRsp[0].MsgContent)
if uc == nil {
return nil, errors.New("failed to decompress gzip data")
}
mt := msg.PbMultiMsgTransmit{}
if err = proto.Unmarshal(uc, &mt); err != nil {
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")