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:
3 files changed
+54
-8
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { JsonObject } from './types';
|
||||
export const SELF_SENT_ECHO_WINDOW_MS = 120_000;
|
||||
|
||||
/**
|
||||
* Match a reported self send with a later QQ echo, including repeated group
|
||||
* Match a reported self send with a later QQ echo, including repeated
|
||||
* pushes. The message hash alone is insufficient because it is a signed 32-bit
|
||||
* value and can collide; sequence, conversation and a bounded time window are
|
||||
* part of the identity as well.
|
||||
|
||||
Reference in new issue
Block a user