Use pl.UserLevel

This commit is contained in:
Till Faelligen 2022-06-09 17:09:23 +02:00
parent 82af906b71
commit 26dd627a2a

View file

@ -833,7 +833,7 @@ func (d *Database) handleRedactions(
return nil, "", fmt.Errorf("unable to get powerlevels for room: %w", err)
}
redactPL := pl.Redact
redactUser := pl.Users[redactionEvent.Sender()]
redactUser := pl.UserLevel(redactionEvent.Sender())
// The power level of the redaction events sender is greater than or equal to the redact level.
userAllowed := redactUser >= redactPL
// The domain of the redaction events sender matches that of the original events sender.