mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-05 03:23:50 +08:00
feature support suspicious request.
This commit is contained in:
parent
7949805c76
commit
cda2f330f0
@ -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.12.3
|
// protoc v3.14.0
|
||||||
// source: structmsg.proto
|
// source: structmsg.proto
|
||||||
|
|
||||||
package structmsg
|
package structmsg
|
||||||
@ -823,6 +823,7 @@ type ReqSystemMsgNew struct {
|
|||||||
IsGetFrdRibbon bool `protobuf:"varint,8,opt,name=isGetFrdRibbon,proto3" json:"isGetFrdRibbon,omitempty"`
|
IsGetFrdRibbon bool `protobuf:"varint,8,opt,name=isGetFrdRibbon,proto3" json:"isGetFrdRibbon,omitempty"`
|
||||||
IsGetGrpRibbon bool `protobuf:"varint,9,opt,name=isGetGrpRibbon,proto3" json:"isGetGrpRibbon,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"`
|
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() {
|
func (x *ReqSystemMsgNew) Reset() {
|
||||||
@ -927,6 +928,13 @@ func (x *ReqSystemMsgNew) GetFriendMsgTypeFlag() int64 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *ReqSystemMsgNew) GetReqMsgType() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.ReqMsgType
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
type ReqSystemMsgRead struct {
|
type ReqSystemMsgRead struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
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,
|
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,
|
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, 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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x46, 0x72,
|
||||||
|
@ -94,6 +94,7 @@ message ReqSystemMsgNew {
|
|||||||
bool isGetFrdRibbon = 8;
|
bool isGetFrdRibbon = 8;
|
||||||
bool isGetGrpRibbon = 9;
|
bool isGetGrpRibbon = 9;
|
||||||
int64 friendMsgTypeFlag = 10;
|
int64 friendMsgTypeFlag = 10;
|
||||||
|
int32 reqMsgType = 11;
|
||||||
}
|
}
|
||||||
message ReqSystemMsgRead {
|
message ReqSystemMsgRead {
|
||||||
int64 latestFriendSeq = 1;
|
int64 latestFriendSeq = 1;
|
||||||
|
@ -35,17 +35,25 @@ type (
|
|||||||
|
|
||||||
Checked bool `json:"checked"`
|
Checked bool `json:"checked"`
|
||||||
Actor int64 `json:"actor"`
|
Actor int64 `json:"actor"`
|
||||||
|
Suspicious bool `json:"suspicious"`
|
||||||
|
|
||||||
client *QQClient
|
client *QQClient
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func (c *QQClient) GetGroupSystemMessages() (*GroupSystemMessages, error) {
|
func (c *QQClient) GetGroupSystemMessages() (*GroupSystemMessages, error) {
|
||||||
i, err := c.sendAndWait(c.buildSystemMsgNewGroupPacket())
|
i, err := c.sendAndWait(c.buildSystemMsgNewGroupPacket(false))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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() {
|
func (c *QQClient) exceptAndDispatchGroupSysMsg() {
|
||||||
@ -88,7 +96,7 @@ func (c *QQClient) exceptAndDispatchGroupSysMsg() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ProfileService.Pb.ReqSystemMsgNew.Group
|
// ProfileService.Pb.ReqSystemMsgNew.Group
|
||||||
func (c *QQClient) buildSystemMsgNewGroupPacket() (uint16, []byte) {
|
func (c *QQClient) buildSystemMsgNewGroupPacket(suspicious bool) (uint16, []byte) {
|
||||||
seq := c.nextSeq()
|
seq := c.nextSeq()
|
||||||
req := &structmsg.ReqSystemMsgNew{
|
req := &structmsg.ReqSystemMsgNew{
|
||||||
MsgNum: 100,
|
MsgNum: 100,
|
||||||
@ -113,6 +121,12 @@ func (c *QQClient) buildSystemMsgNewGroupPacket() (uint16, []byte) {
|
|||||||
GrpMsgGetC2CInviteJoinGroup: 1,
|
GrpMsgGetC2CInviteJoinGroup: 1,
|
||||||
},
|
},
|
||||||
FriendMsgTypeFlag: 1,
|
FriendMsgTypeFlag: 1,
|
||||||
|
ReqMsgType: func() int32 {
|
||||||
|
if suspicious {
|
||||||
|
return 2
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
}(),
|
||||||
}
|
}
|
||||||
payload, _ := proto.Marshal(req)
|
payload, _ := proto.Marshal(req)
|
||||||
packet := packets.BuildUniPacket(c.Uin, seq, "ProfileService.Pb.ReqSystemMsgNew.Group", 1, c.OutGoingPacketSessionId, EmptyBytes, c.sigInfo.d2Key, payload)
|
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,
|
GroupName: st.Msg.GroupName,
|
||||||
Checked: st.Msg.SubType == 2,
|
Checked: st.Msg.SubType == 2,
|
||||||
Actor: st.Msg.ActorUin,
|
Actor: st.Msg.ActorUin,
|
||||||
|
Suspicious: len(st.Msg.WarningTips) > 0,
|
||||||
client: c,
|
client: c,
|
||||||
})
|
})
|
||||||
case 2: // 被邀请
|
case 2: // 被邀请
|
||||||
@ -166,6 +181,7 @@ func decodeSystemMsgGroupPacket(c *QQClient, _ uint16, payload []byte) (interfac
|
|||||||
GroupName: st.Msg.GroupName,
|
GroupName: st.Msg.GroupName,
|
||||||
Checked: st.Msg.SubType == 2,
|
Checked: st.Msg.SubType == 2,
|
||||||
Actor: st.Msg.ActorUin,
|
Actor: st.Msg.ActorUin,
|
||||||
|
Suspicious: len(st.Msg.WarningTips) > 0,
|
||||||
client: c,
|
client: c,
|
||||||
})
|
})
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user