diff --git a/client/client.go b/client/client.go index f5b5b95b..8328cba4 100644 --- a/client/client.go +++ b/client/client.go @@ -490,7 +490,20 @@ func (c *QQClient) GetForwardMessage(resId string) *message.ForwardMessage { } multiMsg := i.(*msg.PbMultiMsgTransmit) ret := &message.ForwardMessage{} - for _, m := range multiMsg.Msg { + if multiMsg.GetPbItemList() == nil { + return nil + } + var msg *msg.PbMultiMsgItem + for _, m := range multiMsg.GetPbItemList() { + if m.GetFileName() == "MultiMsg" { + msg = m + break + } + } + if msg == nil || msg.GetBuffer() == nil || msg.GetBuffer().GetMsg() == nil { + return nil + } + for _, m := range msg.GetBuffer().GetMsg() { ret.Nodes = append(ret.Nodes, &message.ForwardNode{ SenderId: m.Head.GetFromUin(), SenderName: func() string { diff --git a/client/pb/msg/msg.pb.go b/client/pb/msg/msg.pb.go index 409b42f6..b427899e 100644 --- a/client/pb/msg/msg.pb.go +++ b/client/pb/msg/msg.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 -// protoc v3.11.4 +// protoc v3.13.0 // source: msg.proto package msg @@ -6041,8 +6041,8 @@ type PbMultiMsgItem struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FileName *string `protobuf:"bytes,1,opt,name=fileName" json:"fileName,omitempty"` - Buffer []byte `protobuf:"bytes,2,opt,name=buffer" json:"buffer,omitempty"` + FileName *string `protobuf:"bytes,1,opt,name=fileName" json:"fileName,omitempty"` + Buffer *PbMultiMsgNew `protobuf:"bytes,2,opt,name=buffer" json:"buffer,omitempty"` } func (x *PbMultiMsgItem) Reset() { @@ -6084,7 +6084,7 @@ func (x *PbMultiMsgItem) GetFileName() string { return "" } -func (x *PbMultiMsgItem) GetBuffer() []byte { +func (x *PbMultiMsgItem) GetBuffer() *PbMultiMsgNew { if x != nil { return x.Buffer } @@ -7692,11 +7692,12 @@ var file_msg_proto_rawDesc = []byte{ 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x70, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x70, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x62, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x09, 0x70, 0x62, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x22, 0x44, 0x0a, 0x0e, 0x50, + 0x52, 0x09, 0x70, 0x62, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x22, 0x54, 0x0a, 0x0e, 0x50, 0x62, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x4d, 0x73, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x66, - 0x66, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x62, 0x75, 0x66, 0x66, 0x65, + 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x62, 0x75, 0x66, + 0x66, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x50, 0x62, 0x4d, 0x75, + 0x6c, 0x74, 0x69, 0x4d, 0x73, 0x67, 0x4e, 0x65, 0x77, 0x52, 0x06, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x22, 0x2b, 0x0a, 0x0d, 0x50, 0x62, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x4d, 0x73, 0x67, 0x4e, 0x65, 0x77, 0x12, 0x1a, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x61, @@ -7927,19 +7928,20 @@ var file_msg_proto_depIdxs = []int32{ 52, // 55: InstCtrl.msgExcludeInst:type_name -> InstInfo 52, // 56: InstCtrl.msgFromInst:type_name -> InstInfo 53, // 57: TransMsgInfo.extGroupKeyInfo:type_name -> ExtGroupKeyInfo - 20, // 58: PbMultiMsgNew.msg:type_name -> Message - 20, // 59: PbMultiMsgTransmit.msg:type_name -> Message - 57, // 60: PbMultiMsgTransmit.pbItemList:type_name -> PbMultiMsgItem - 44, // 61: MsgElemInfo_servtype3.flash_troop_pic:type_name -> CustomFace - 34, // 62: MsgElemInfo_servtype3.flash_c2c_pic:type_name -> NotOnlineImage - 35, // 63: SubMsgType0x4Body.notOnlineFile:type_name -> NotOnlineFile - 64, // 64: ResvAttr.image_show:type_name -> AnimationImageShow - 20, // 65: GetGroupMsgResp.msg:type_name -> Message - 66, // [66:66] is the sub-list for method output_type - 66, // [66:66] is the sub-list for method input_type - 66, // [66:66] is the sub-list for extension type_name - 66, // [66:66] is the sub-list for extension extendee - 0, // [0:66] is the sub-list for field type_name + 58, // 58: PbMultiMsgItem.buffer:type_name -> PbMultiMsgNew + 20, // 59: PbMultiMsgNew.msg:type_name -> Message + 20, // 60: PbMultiMsgTransmit.msg:type_name -> Message + 57, // 61: PbMultiMsgTransmit.pbItemList:type_name -> PbMultiMsgItem + 44, // 62: MsgElemInfo_servtype3.flash_troop_pic:type_name -> CustomFace + 34, // 63: MsgElemInfo_servtype3.flash_c2c_pic:type_name -> NotOnlineImage + 35, // 64: SubMsgType0x4Body.notOnlineFile:type_name -> NotOnlineFile + 64, // 65: ResvAttr.image_show:type_name -> AnimationImageShow + 20, // 66: GetGroupMsgResp.msg:type_name -> Message + 67, // [67:67] is the sub-list for method output_type + 67, // [67:67] is the sub-list for method input_type + 67, // [67:67] is the sub-list for extension type_name + 67, // [67:67] is the sub-list for extension extendee + 0, // [0:67] is the sub-list for field type_name } func init() { file_msg_proto_init() } diff --git a/client/pb/msg/msg.proto b/client/pb/msg/msg.proto index 01757128..9b5a26d0 100644 --- a/client/pb/msg/msg.proto +++ b/client/pb/msg/msg.proto @@ -700,7 +700,7 @@ message GeneralFlags { message PbMultiMsgItem { optional string fileName = 1; - optional bytes buffer = 2; + optional PbMultiMsgNew buffer = 2; } message PbMultiMsgNew { repeated Message msg = 1; diff --git a/message/message.go b/message/message.go index 7c79f06b..746d8a89 100644 --- a/message/message.go +++ b/message/message.go @@ -557,11 +557,10 @@ func (forMsg *ForwardMessage) CalculateValidationData(seq, random int32, groupCo }, }) } - buf, _ := proto.Marshal(&msg.PbMultiMsgNew{Msg: msgs}) trans := &msg.PbMultiMsgTransmit{Msg: msgs, PbItemList: []*msg.PbMultiMsgItem{ { FileName: proto.String("MultiMsg"), - Buffer: buf, + Buffer: &msg.PbMultiMsgNew{Msg: msgs}, }, }} b, _ := proto.Marshal(trans)