feat(protocol): decode online device snapshots
Decode Event 0x210 subtype 349 into typed online-device snapshots, including QQ-compatible low-byte client type normalization and one-entry-per-device-category projection. Keep replacement snapshots outside system-message deduplication, reject malformed device identities observably, and add wire-level regressions for complete, packed, repeated, and invalid payloads. Live verification covered mobile account switching without requiring native changes.
This commit is contained in:
8 files changed
+279
-3
No files matched your search
@@ -486,6 +486,28 @@ export interface FriendInputStatusEvent extends QQEvent {
|
||||
statusText: string;
|
||||
}
|
||||
|
||||
export type OnlineDeviceKind = 'computer' | 'pad' | 'phone' | 'unknown';
|
||||
|
||||
/** One entry from QQ NT's online-device cache notification. */
|
||||
export interface OnlineDeviceInfo {
|
||||
appId: number;
|
||||
instanceId: number;
|
||||
clientType: number;
|
||||
platform: number;
|
||||
deviceName: string;
|
||||
deviceKind: OnlineDeviceKind;
|
||||
}
|
||||
|
||||
/**
|
||||
* Full online-device snapshot pushed through Event 0x210 / subType 349.
|
||||
* Internal-only: Bridge consumes this to maintain the query snapshot; it is
|
||||
* not forwarded as an OneBot event.
|
||||
*/
|
||||
export interface OnlineDevicesChangedEvent extends QQEvent {
|
||||
kind: 'online_devices_changed';
|
||||
devices: OnlineDeviceInfo[];
|
||||
}
|
||||
|
||||
export type QQEventVariant =
|
||||
| FriendMessage
|
||||
| GroupMessage
|
||||
@@ -510,4 +532,5 @@ export type QQEventVariant =
|
||||
| GroupCardChangeEvent
|
||||
| GroupTitleChangeEvent
|
||||
| FriendProfileLikeEvent
|
||||
| OnlineDevicesChangedEvent
|
||||
| BotOfflineEvent;
|
||||
Reference in new issue
Block a user