refactor(bridge): split MsgPush handler into per-PkgType decoders
The 885-line msg-push-handler.ts is replaced by bridge/msg-push/: 8 per-PkgType decoders plus MsgPushRegistry (single decoder per PkgType, catch + log on error), MsgPushContext (header decoded once at entry), and rich-body-decoder (one deep function hides ~400 lines of element conversion shared by all three message types). parseMsgPush(pkt, identity) signature preserved; existing tests pass with an import-path change only.
This commit is contained in:
18 files changed
+1136
-888
No files matched your search
@@ -0,0 +1,33 @@
|
||||
// MsgPush PkgType taxonomy. The top-level msgType field in PushMsg.contentHead
|
||||
// names a QQ-protocol-defined packet shape; Event0x210 / Event0x2DC are wrapper
|
||||
// PkgTypes whose payload is further dispatched by subType.
|
||||
|
||||
export enum PkgType {
|
||||
ForwardFakePrivateMessage = 9,
|
||||
PrivateMessage = 166,
|
||||
GroupMessage = 82,
|
||||
TempMessage = 141,
|
||||
Event0x210 = 528,
|
||||
Event0x2DC = 732,
|
||||
PrivateRecordMessage = 208,
|
||||
PrivateFileMessage = 529,
|
||||
GroupRequestInvitationNotice = 525,
|
||||
GroupRequestJoinNotice = 84,
|
||||
GroupInviteNotice = 87,
|
||||
GroupAdminChangedNotice = 44,
|
||||
GroupMemberIncreaseNotice = 33,
|
||||
GroupMemberDecreaseNotice = 34,
|
||||
}
|
||||
|
||||
export enum Event0x2DCSubType {
|
||||
GroupMuteNotice = 12,
|
||||
GroupRecallNotice = 17,
|
||||
GroupGreyTipNotice = 20,
|
||||
GroupEssenceNotice = 21,
|
||||
}
|
||||
|
||||
export enum Event0x210SubType {
|
||||
FriendRequestNotice = 35,
|
||||
FriendRecallNotice = 138,
|
||||
FriendPokeNotice = 290,
|
||||
}
|
||||
Reference in new issue
Block a user