From 4bb8da51dd0e2b33c0135d5c48231d17029cfdb5 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Thu, 10 Apr 2025 10:28:30 +0100 Subject: [PATCH] Ignore redactions in BasicFlooding (fixes #804) (#805) Fixes #804 by not considering m.room.redaction when processing basic flood protection. --- src/protections/BasicFlooding.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/protections/BasicFlooding.ts b/src/protections/BasicFlooding.ts index 5d9001e8..f4dafed5 100644 --- a/src/protections/BasicFlooding.ts +++ b/src/protections/BasicFlooding.ts @@ -173,6 +173,12 @@ export class BasicFloodingProtection log.debug(`Ignoring message from self: ${event.event_id}`); return Ok(undefined); } + // If the event is a redaction, ignore it. + // See also: https://github.com/the-draupnir-project/Draupnir/issues/804 + if (event["type"] === "m.room.redaction") { + log.debug(`Ignoring redaction: ${event.event_id}`); + return Ok(undefined); + } const forUser = lastEventsForUser( this.lastEvents, event.room_id,