fix(onebot): report API-sent private messages

Emit message_sent.private after successful friend messages sent through OneBot actions or the WebUI debug console when QQ does not provide an inbound self echo.

Keep a later QQ echo as the canonical stored event while suppressing duplicate downstream delivery across both race orders. Match echoes by conversation, sequence, message ID, and a bounded time window; leave group messages, temporary sessions, split file sends, unreliable receipts, and messages sent manually from the QQ client unchanged.

Add regression coverage for action-only reporting, both echo race orders, hash collisions, cached-but-unreported events, temporary sessions, and incomplete receipts.

Fixes #251
This commit is contained in:
DrSmoothl committed 2026-07-20 13:02:29 +08:00
1 parent 810d72fa04
commit 8df62d6486
6 files changed
+390 -38

No files matched your search

+1 -1
View File
@@ -180,7 +180,7 @@ async function runConvertAndDispatch(ctx: OneBotInstanceContext, log: Logger, ev
error instanceof Error ? (error.stack ?? error.message) : String(error),
);
}
ctx.dispatchEvent(converted);
ctx.dispatchEvent(converted, 'bridge');
log.trace(() => [`recv ${event.kind} ⇒ ${String(converted.post_type ?? '?')} (${Date.now() - startedAt}ms)`]);
}