fix: avoid duplicate private self-message reports

Keep repeated confirmations of the same private message from producing duplicate events while preserving distinct messages and stored content.

Refs #528.
This commit is contained in:
DrSmoothl committed 2026-10-21 16:59:19 +08:00
1 parent 27120f884a
commit 617e7581dd
3 files changed
+54 -8

No files matched your search

+1 -7
View File
@@ -479,7 +479,7 @@ export class OneBotInstance {
return;
}
if (event.post_type === 'message_sent' && event.message_type === 'group') {
if (event.post_type === 'message_sent') {
this.rememberSelfSentEvent(event);
}
} else {
@@ -554,12 +554,6 @@ export class OneBotInstance {
return false;
}
// A client group send has no action-side event. Keep its first live
// echo for the full window so repeated pushes cannot report it again.
if (event.message_type !== 'group') {
this.recentSelfSentEvents.delete(key);
}
return true;
}