From 6c1b62210734c9aef85012a1dec4458c310eadad Mon Sep 17 00:00:00 2001 From: wdvxdr Date: Thu, 16 Dec 2021 14:27:26 +0800 Subject: [PATCH] remove `PttStore.GroupPttUp` --- client/client.go | 1 - client/entities.go | 14 -------------- client/ptt.go | 39 --------------------------------------- 3 files changed, 54 deletions(-) diff --git a/client/client.go b/client/client.go index 4c4e5758..4f5f358b 100644 --- a/client/client.go +++ b/client/client.go @@ -168,7 +168,6 @@ var decoders = map[string]func(*QQClient, *incomingPacketInfo, []byte) (interfac "friendlist.GetTroopListReqV2": decodeGroupListResponse, "friendlist.GetTroopMemberListReq": decodeGroupMemberListResponse, "group_member_card.get_group_member_card_info": decodeGroupMemberInfoResponse, - "PttStore.GroupPttUp": decodeGroupPttStoreResponse, "LongConn.OffPicUp": decodeOffPicUpResponse, "ProfileService.Pb.ReqSystemMsgNew.Group": decodeSystemMsgGroupPacket, "ProfileService.Pb.ReqSystemMsgNew.Friend": decodeSystemMsgFriendPacket, diff --git a/client/entities.go b/client/entities.go index 47bb79ed..d6d70038 100644 --- a/client/entities.go +++ b/client/entities.go @@ -284,20 +284,6 @@ type ( list []*GroupMemberInfo } - pttUploadResponse struct { - ResultCode int32 - Message string - - IsExists bool - - ResourceId string - UploadKey []byte - UploadIp []string - UploadPort []uint32 - FileKey []byte - FileId int64 - } - groupMessageReceiptEvent struct { Rand int32 Seq int32 diff --git a/client/ptt.go b/client/ptt.go index 62603f7e..76ac4fd4 100644 --- a/client/ptt.go +++ b/client/ptt.go @@ -8,7 +8,6 @@ import ( "github.com/pkg/errors" - "github.com/Mrs4s/MiraiGo/binary" "github.com/Mrs4s/MiraiGo/client/internal/highway" "github.com/Mrs4s/MiraiGo/client/pb/cmd0x346" "github.com/Mrs4s/MiraiGo/client/pb/cmd0x388" @@ -201,14 +200,6 @@ func (c *QQClient) GetShortVideoUrl(uuid, md5 []byte) string { return i.(string) } -// PttStore.GroupPttUp -func (c *QQClient) buildGroupPttStorePacket(groupCode int64, md5 []byte, size, codec, voiceLength int32) (uint16, []byte) { - seq := c.nextSeq() - packet := packets.BuildUniPacket(c.Uin, seq, "PttStore.GroupPttUp", 1, c.OutGoingPacketSessionId, - EmptyBytes, c.sigInfo.d2Key, c.buildGroupPttStoreBDHExt(groupCode, md5, size, codec, voiceLength)) - return seq, packet -} - func (c *QQClient) buildGroupPttStoreBDHExt(groupCode int64, md5 []byte, size, codec, voiceLength int32) []byte { req := &cmd0x388.D388ReqBody{ NetType: proto.Uint32(3), @@ -302,36 +293,6 @@ func (c *QQClient) buildPttGroupShortVideoUploadReqPacket(videoHash, thumbHash [ return seq, packet } -// PttStore.GroupPttUp -func decodeGroupPttStoreResponse(_ *QQClient, _ *incomingPacketInfo, payload []byte) (interface{}, error) { - pkt := cmd0x388.D388RspBody{} - err := proto.Unmarshal(payload, &pkt) - if err != nil { - return nil, errors.Wrap(err, "failed to unmarshal protobuf message") - } - rsp := pkt.TryupPttRsp[0] - if rsp.GetResult() != 0 { - return pttUploadResponse{ - ResultCode: int32(rsp.GetResult()), - Message: utils.B2S(rsp.GetFailMsg()), - }, nil - } - if rsp.GetFileExit() { - return pttUploadResponse{IsExists: true}, nil - } - ip := make([]string, 0, len(rsp.GetUpIp())) - for _, i := range rsp.GetUpIp() { - ip = append(ip, binary.UInt32ToIPV4Address(i)) - } - return pttUploadResponse{ - UploadKey: rsp.UpUkey, - UploadIp: ip, - UploadPort: rsp.GetUpPort(), - FileKey: rsp.FileKey, - FileId: int64(rsp.GetFileid()), - }, nil -} - // PttCenterSvr.pb_pttCenter_CMD_REQ_APPLY_UPLOAD-500 func (c *QQClient) buildC2CPttStoreBDHExt(target int64, md5 []byte, size, voiceLength int32) []byte { seq := c.nextSeq()