mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-05 03:23:50 +08:00
Merge pull request #86 from wdvxdr1123/patch/forwardmsg
get forward msg Матрёшка
This commit is contained in:
commit
044d5c8edc
@ -490,7 +490,20 @@ func (c *QQClient) GetForwardMessage(resId string) *message.ForwardMessage {
|
|||||||
}
|
}
|
||||||
multiMsg := i.(*msg.PbMultiMsgTransmit)
|
multiMsg := i.(*msg.PbMultiMsgTransmit)
|
||||||
ret := &message.ForwardMessage{}
|
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{
|
ret.Nodes = append(ret.Nodes, &message.ForwardNode{
|
||||||
SenderId: m.Head.GetFromUin(),
|
SenderId: m.Head.GetFromUin(),
|
||||||
SenderName: func() string {
|
SenderName: func() string {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.25.0
|
// protoc-gen-go v1.25.0
|
||||||
// protoc v3.11.4
|
// protoc v3.13.0
|
||||||
// source: msg.proto
|
// source: msg.proto
|
||||||
|
|
||||||
package msg
|
package msg
|
||||||
@ -6042,7 +6042,7 @@ type PbMultiMsgItem struct {
|
|||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
FileName *string `protobuf:"bytes,1,opt,name=fileName" json:"fileName,omitempty"`
|
FileName *string `protobuf:"bytes,1,opt,name=fileName" json:"fileName,omitempty"`
|
||||||
Buffer []byte `protobuf:"bytes,2,opt,name=buffer" json:"buffer,omitempty"`
|
Buffer *PbMultiMsgNew `protobuf:"bytes,2,opt,name=buffer" json:"buffer,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *PbMultiMsgItem) Reset() {
|
func (x *PbMultiMsgItem) Reset() {
|
||||||
@ -6084,7 +6084,7 @@ func (x *PbMultiMsgItem) GetFileName() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *PbMultiMsgItem) GetBuffer() []byte {
|
func (x *PbMultiMsgItem) GetBuffer() *PbMultiMsgNew {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Buffer
|
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,
|
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,
|
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,
|
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,
|
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, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x66,
|
0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x62, 0x75, 0x66,
|
||||||
0x66, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x62, 0x75, 0x66, 0x66, 0x65,
|
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,
|
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,
|
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,
|
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, // 55: InstCtrl.msgExcludeInst:type_name -> InstInfo
|
||||||
52, // 56: InstCtrl.msgFromInst:type_name -> InstInfo
|
52, // 56: InstCtrl.msgFromInst:type_name -> InstInfo
|
||||||
53, // 57: TransMsgInfo.extGroupKeyInfo:type_name -> ExtGroupKeyInfo
|
53, // 57: TransMsgInfo.extGroupKeyInfo:type_name -> ExtGroupKeyInfo
|
||||||
20, // 58: PbMultiMsgNew.msg:type_name -> Message
|
58, // 58: PbMultiMsgItem.buffer:type_name -> PbMultiMsgNew
|
||||||
20, // 59: PbMultiMsgTransmit.msg:type_name -> Message
|
20, // 59: PbMultiMsgNew.msg:type_name -> Message
|
||||||
57, // 60: PbMultiMsgTransmit.pbItemList:type_name -> PbMultiMsgItem
|
20, // 60: PbMultiMsgTransmit.msg:type_name -> Message
|
||||||
44, // 61: MsgElemInfo_servtype3.flash_troop_pic:type_name -> CustomFace
|
57, // 61: PbMultiMsgTransmit.pbItemList:type_name -> PbMultiMsgItem
|
||||||
34, // 62: MsgElemInfo_servtype3.flash_c2c_pic:type_name -> NotOnlineImage
|
44, // 62: MsgElemInfo_servtype3.flash_troop_pic:type_name -> CustomFace
|
||||||
35, // 63: SubMsgType0x4Body.notOnlineFile:type_name -> NotOnlineFile
|
34, // 63: MsgElemInfo_servtype3.flash_c2c_pic:type_name -> NotOnlineImage
|
||||||
64, // 64: ResvAttr.image_show:type_name -> AnimationImageShow
|
35, // 64: SubMsgType0x4Body.notOnlineFile:type_name -> NotOnlineFile
|
||||||
20, // 65: GetGroupMsgResp.msg:type_name -> Message
|
64, // 65: ResvAttr.image_show:type_name -> AnimationImageShow
|
||||||
66, // [66:66] is the sub-list for method output_type
|
20, // 66: GetGroupMsgResp.msg:type_name -> Message
|
||||||
66, // [66:66] is the sub-list for method input_type
|
67, // [67:67] is the sub-list for method output_type
|
||||||
66, // [66:66] is the sub-list for extension type_name
|
67, // [67:67] is the sub-list for method input_type
|
||||||
66, // [66:66] is the sub-list for extension extendee
|
67, // [67:67] is the sub-list for extension type_name
|
||||||
0, // [0:66] is the sub-list for field 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() }
|
func init() { file_msg_proto_init() }
|
||||||
|
@ -700,7 +700,7 @@ message GeneralFlags {
|
|||||||
|
|
||||||
message PbMultiMsgItem {
|
message PbMultiMsgItem {
|
||||||
optional string fileName = 1;
|
optional string fileName = 1;
|
||||||
optional bytes buffer = 2;
|
optional PbMultiMsgNew buffer = 2;
|
||||||
}
|
}
|
||||||
message PbMultiMsgNew {
|
message PbMultiMsgNew {
|
||||||
repeated Message msg = 1;
|
repeated Message msg = 1;
|
||||||
|
@ -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{
|
trans := &msg.PbMultiMsgTransmit{Msg: msgs, PbItemList: []*msg.PbMultiMsgItem{
|
||||||
{
|
{
|
||||||
FileName: proto.String("MultiMsg"),
|
FileName: proto.String("MultiMsg"),
|
||||||
Buffer: buf,
|
Buffer: &msg.PbMultiMsgNew{Msg: msgs},
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
b, _ := proto.Marshal(trans)
|
b, _ := proto.Marshal(trans)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user