Ignore events that redact themselves

This commit is contained in:
Kegan Dougal 2020-07-07 12:51:34 +01:00
parent 007afcae60
commit 7428a444b7

View file

@ -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(),