1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 19:17:38 +08:00

Friend delete handling

This commit is contained in:
Sam 2021-03-11 21:05:12 +08:00
parent c9ea0ae6c1
commit cc6540ec98
2 changed files with 4 additions and 6 deletions

View File

@ -38,9 +38,6 @@ 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

@ -119,10 +119,11 @@ func decodeMultiApplyDownResponse(_ *QQClient, _ *incomingPacketInfo, payload []
if err = proto.Unmarshal(data, &lb); err != nil {
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")
msgContent := lb.MsgDownRsp[0].MsgContent
if msgContent == nil {
return nil, errors.New("message content is empty")
}
uc := binary.GZipUncompress(msgContent)
mt := msg.PbMultiMsgTransmit{}
if err = proto.Unmarshal(uc, &mt); err != nil {
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")