fix(onebot): correct private message history (#256)

Use the C2C roam cursor and canonical NT sequence for bidirectional history. Persist direction-aware recall tombstones so recalled messages cannot reappear.
This commit is contained in:
DrSmoothl committed 2026-07-20 22:25:13 +08:00
1 parent 88216ce644
commit 4aa2cd1693
37 files changed
+1853 -242

No files matched your search

+15
View File
@@ -235,7 +235,14 @@ export interface FriendMessage extends QQEvent {
* index can preserve the exact C2C peer instead of re-resolving its UIN. */
senderUid?: string;
senderNick: string;
/** Sender-local sequence exposed as OneBot message_seq and used by replies. */
msgSeq: number;
/** Bidirectional C2C sequence used for history/actions and canonical message ids. */
ntMsgSeq?: number;
/** Sender-local sequence used by private recall requests. */
clientSeq?: number;
/** False only when an older packet omitted ContentHead field 11. */
sequenceAuthoritative?: boolean;
msgId: number;
elements: MessageElement[];
}
@@ -263,6 +270,9 @@ export interface TempMessage extends QQEvent {
groupId: number;
senderNick: string;
msgSeq: number;
ntMsgSeq?: number;
clientSeq?: number;
sequenceAuthoritative?: boolean;
elements: MessageElement[];
}
@@ -314,7 +324,12 @@ export interface GroupAdminEvent extends QQEvent {
export interface FriendRecall extends QQEvent {
kind: 'friend_recall';
userUin: number;
/** Legacy alias retained for converters; this is the sender-local sequence. */
msgSeq: number;
/** Sender-local sequence carried by the recall protocol. */
clientSeq?: number;
/** True for subtype 139, where the logged-in account recalled its own send. */
recalledBySelf?: boolean;
}
export interface GroupRecallEvent extends QQEvent {