17
17
PBGroupAlbumUpdate ,
18
18
PBGroupInvite ,
19
19
)
20
+ from lagrange .pb .status .friend import (
21
+ PBFriendRecall
22
+ )
20
23
from lagrange .utils .binary .protobuf import proto_decode , ProtoStruct , proto_encode
21
24
from lagrange .utils .binary .reader import Reader
22
25
from lagrange .utils .operator import unpack_dict , timestamp
34
37
GroupReaction ,
35
38
GroupSign ,
36
39
GroupAlbumUpdate ,
40
+ GroupInviteAccept
41
+ )
42
+ from ..events .friend import (
43
+ FriendRecall
37
44
)
38
45
from ..wtlogin .sso import SSOPacket
39
46
from .log import logger
@@ -90,7 +97,18 @@ async def msg_push_handler(client: "Client", sso: SSOPacket):
90
97
if pb .cmd == 87 :
91
98
inn = pb .info .inner
92
99
return GroupMemberJoinRequest (grp_id = inn .grp_id , uid = inn .uid , invitor_uid = inn .invitor_uid )
93
- elif typ == 0x210 : # friend event / group file upload notice event
100
+ elif typ == 0x210 : # friend event, 528 / group file upload notice event
101
+ if sub_typ == 138 : # friend recall
102
+ pb = PBFriendRecall .decode (pkg .message .buf2 )
103
+ return FriendRecall (
104
+ pkg .response_head .from_uin ,
105
+ pb .info .from_uid ,
106
+ pkg .response_head .to_uin ,
107
+ pb .info .to_uid ,
108
+ pb .info .seq ,
109
+ pb .info .random ,
110
+ pb .info .time
111
+ )
94
112
logger .debug (f"unhandled friend event / group file upload notice event: { pkg } " ) # TODO: paste
95
113
elif typ == 0x2DC : # grp event, 732
96
114
if sub_typ == 20 : # nudge and group_sign(群打卡)
@@ -106,6 +124,12 @@ async def msg_push_handler(client: "Client", sso: SSOPacket):
106
124
attrs [k .decode ()] = int (v .decode ())
107
125
else :
108
126
attrs [k .decode ()] = v .decode ()
127
+ if pb .body .type == 1 :
128
+ return GroupInviteAccept (
129
+ grp_id ,
130
+ attrs ["invitor" ],
131
+ attrs ["invitee" ]
132
+ )
109
133
if pb .body .type == 12 :
110
134
return GroupNudge (
111
135
grp_id ,
0 commit comments