diff --git a/client/pb/structmsg/structmsg.pb.go b/client/pb/structmsg/structmsg.pb.go index a1cdfdda..47700777 100644 --- a/client/pb/structmsg/structmsg.pb.go +++ b/client/pb/structmsg/structmsg.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 -// protoc v3.12.3 +// protoc v3.14.0 // source: structmsg.proto package structmsg @@ -823,6 +823,7 @@ type ReqSystemMsgNew struct { IsGetFrdRibbon bool `protobuf:"varint,8,opt,name=isGetFrdRibbon,proto3" json:"isGetFrdRibbon,omitempty"` IsGetGrpRibbon bool `protobuf:"varint,9,opt,name=isGetGrpRibbon,proto3" json:"isGetGrpRibbon,omitempty"` FriendMsgTypeFlag int64 `protobuf:"varint,10,opt,name=friendMsgTypeFlag,proto3" json:"friendMsgTypeFlag,omitempty"` + ReqMsgType int32 `protobuf:"varint,11,opt,name=reqMsgType,proto3" json:"reqMsgType,omitempty"` } func (x *ReqSystemMsgNew) Reset() { @@ -927,6 +928,13 @@ func (x *ReqSystemMsgNew) GetFriendMsgTypeFlag() int64 { return 0 } +func (x *ReqSystemMsgNew) GetReqMsgType() int32 { + if x != nil { + return x.ReqMsgType + } + return 0 +} + type ReqSystemMsgRead struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2468,7 +2476,7 @@ var file_structmsg_proto_rawDesc = []byte{ 0x73, 0x74, 0x65, 0x6d, 0x4d, 0x73, 0x67, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x22, 0xec, 0x02, 0x0a, 0x0f, 0x52, 0x65, + 0x08, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x22, 0x8c, 0x03, 0x0a, 0x0f, 0x52, 0x65, 0x71, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4d, 0x73, 0x67, 0x4e, 0x65, 0x77, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x73, 0x67, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x73, 0x67, 0x4e, 0x75, 0x6d, 0x12, 0x28, 0x0a, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x46, @@ -2491,7 +2499,9 @@ var file_structmsg_proto_rawDesc = []byte{ 0x74, 0x47, 0x72, 0x70, 0x52, 0x69, 0x62, 0x62, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x11, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, - 0x54, 0x79, 0x70, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x22, 0x96, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x71, + 0x54, 0x79, 0x70, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x4d, + 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, + 0x71, 0x4d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x22, 0x96, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x71, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x61, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x46, 0x72, diff --git a/client/pb/structmsg/structmsg.proto b/client/pb/structmsg/structmsg.proto index f7501cc8..ebf04b7b 100644 --- a/client/pb/structmsg/structmsg.proto +++ b/client/pb/structmsg/structmsg.proto @@ -94,6 +94,7 @@ message ReqSystemMsgNew { bool isGetFrdRibbon = 8; bool isGetGrpRibbon = 9; int64 friendMsgTypeFlag = 10; + int32 reqMsgType = 11; } message ReqSystemMsgRead { int64 latestFriendSeq = 1; diff --git a/client/system_msg.go b/client/system_msg.go index f06ca3e2..491306d7 100644 --- a/client/system_msg.go +++ b/client/system_msg.go @@ -33,19 +33,27 @@ type ( GroupCode int64 `json:"group_id"` GroupName string `json:"group_name"` - Checked bool `json:"checked"` - Actor int64 `json:"actor"` + Checked bool `json:"checked"` + Actor int64 `json:"actor"` + Suspicious bool `json:"suspicious"` client *QQClient } ) func (c *QQClient) GetGroupSystemMessages() (*GroupSystemMessages, error) { - i, err := c.sendAndWait(c.buildSystemMsgNewGroupPacket()) + i, err := c.sendAndWait(c.buildSystemMsgNewGroupPacket(false)) if err != nil { return nil, err } - return i.(*GroupSystemMessages), nil + msg := i.(*GroupSystemMessages) + i, err = c.sendAndWait(c.buildSystemMsgNewGroupPacket(true)) + if err != nil { + return nil, err + } + msg.InvitedRequests = append(msg.InvitedRequests, i.(*GroupSystemMessages).InvitedRequests...) + msg.JoinRequests = append(msg.JoinRequests, i.(*GroupSystemMessages).JoinRequests...) + return msg, nil } func (c *QQClient) exceptAndDispatchGroupSysMsg() { @@ -88,7 +96,7 @@ func (c *QQClient) exceptAndDispatchGroupSysMsg() { } // ProfileService.Pb.ReqSystemMsgNew.Group -func (c *QQClient) buildSystemMsgNewGroupPacket() (uint16, []byte) { +func (c *QQClient) buildSystemMsgNewGroupPacket(suspicious bool) (uint16, []byte) { seq := c.nextSeq() req := &structmsg.ReqSystemMsgNew{ MsgNum: 100, @@ -113,6 +121,12 @@ func (c *QQClient) buildSystemMsgNewGroupPacket() (uint16, []byte) { GrpMsgGetC2CInviteJoinGroup: 1, }, FriendMsgTypeFlag: 1, + ReqMsgType: func() int32 { + if suspicious { + return 2 + } + return 1 + }(), } payload, _ := proto.Marshal(req) packet := packets.BuildUniPacket(c.Uin, seq, "ProfileService.Pb.ReqSystemMsgNew.Group", 1, c.OutGoingPacketSessionId, EmptyBytes, c.sigInfo.d2Key, payload) @@ -143,6 +157,7 @@ func decodeSystemMsgGroupPacket(c *QQClient, _ uint16, payload []byte) (interfac GroupName: st.Msg.GroupName, Checked: st.Msg.SubType == 2, Actor: st.Msg.ActorUin, + Suspicious: len(st.Msg.WarningTips) > 0, client: c, }) case 2: // 被邀请 @@ -166,6 +181,7 @@ func decodeSystemMsgGroupPacket(c *QQClient, _ uint16, payload []byte) (interfac GroupName: st.Msg.GroupName, Checked: st.Msg.SubType == 2, Actor: st.Msg.ActorUin, + Suspicious: len(st.Msg.WarningTips) > 0, client: c, }) default: