From 7428a444b746b983b14a8a7a4e68fa9ccba7426c Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 7 Jul 2020 12:51:34 +0100 Subject: [PATCH] Ignore events that redact themselves --- roomserver/storage/shared/storage.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roomserver/storage/shared/storage.go b/roomserver/storage/shared/storage.go index 35ebc890f..a9cb57821 100644 --- a/roomserver/storage/shared/storage.go +++ b/roomserver/storage/shared/storage.go @@ -540,6 +540,11 @@ func (d *Database) handleRedactions( var err error isRedactionEvent := event.Type() == gomatrixserverlib.MRoomRedaction && event.StateKey() == nil if isRedactionEvent { + // an event which redacts itself should be ignored + if event.EventID() == event.Redacts() { + return nil, "", nil + } + err = d.RedactionsTable.InsertRedaction(ctx, txn, tables.RedactionInfo{ Validated: false, RedactionEventID: event.EventID(),