diff options
author | Erik Johnston <erik@matrix.org> | 2019-01-28 21:09:45 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-01-29 11:56:20 +0000 |
commit | 7709d2bd167e27493b134e938410c307f8c10396 (patch) | |
tree | 50f41d8957288a492a066de6d1fb8b7ff0092c77 /synapse/handlers/message.py | |
parent | Add RoomVersions.V3 constant, without enabling it (diff) | |
download | synapse-7709d2bd167e27493b134e938410c307f8c10396.tar.xz |
Implement rechecking of redactions
Diffstat (limited to '')
-rw-r--r-- | synapse/handlers/message.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index 05d1370c18..0cfced43d5 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -767,7 +767,8 @@ class EventCreationHandler(object): auth_events = { (e.type, e.state_key): e for e in auth_events.values() } - if self.auth.check_redaction(event, auth_events=auth_events): + room_version = yield self.store.get_room_version(event.room_id) + if self.auth.check_redaction(room_version, event, auth_events=auth_events): original_event = yield self.store.get_event( event.redacts, check_redacted=False, @@ -781,6 +782,9 @@ class EventCreationHandler(object): "You don't have permission to redact events" ) + # We've already checked. + event.internal_metadata.recheck_redaction = False + if event.type == EventTypes.Create: prev_state_ids = yield context.get_prev_state_ids(self.store) if prev_state_ids: |