Skip to content

Commit 2e95ee9

Browse files
committed
fix(msg): GroupInviteAccept parse error
1 parent 59e177b commit 2e95ee9

File tree

1 file changed

+13
-6
lines changed
  • lagrange/client/server_push

1 file changed

+13
-6
lines changed

lagrange/client/server_push/msg.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,19 @@ async def msg_push_handler(client: "Client", sso: SSOPacket):
125125
else:
126126
attrs[k.decode()] = v.decode()
127127
if pb.body.type == 1:
128-
return GroupInviteAccept(
129-
grp_id,
130-
attrs["invitor"],
131-
attrs["invitee"]
132-
)
133-
if pb.body.type == 12:
128+
if "invitor" in attrs:
129+
# reserve: attrs["msg_nums"]
130+
return GroupInviteAccept(
131+
grp_id,
132+
attrs["invitor"],
133+
attrs["invitee"]
134+
)
135+
elif "user" in attrs and "uin" in attrs:
136+
# todo: 群代办
137+
pass
138+
else:
139+
raise TypeError(f"Unhandled GrayTips with attribute: {attrs}")
140+
elif pb.body.type == 12:
134141
return GroupNudge(
135142
grp_id,
136143
attrs["uin_str1"],

0 commit comments

Comments
 (0)