diff options
author | Erik Johnston <erikj@jki.re> | 2019-01-29 23:07:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-29 23:07:00 +0000 |
commit | e12313ba2571c8e416136b9eb1e6620504d9a113 (patch) | |
tree | b62b1658804c8f76cde6f5a9d24e7aff3af56438 /synapse/handlers/message.py | |
parent | Merge pull request #4514 from matrix-org/erikj/remove_event_id (diff) | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/redactions... (diff) | |
download | synapse-e12313ba2571c8e416136b9eb1e6620504d9a113.tar.xz |
Merge pull request #4499 from matrix-org/erikj/redactions_eiah
Implement rechecking of redactions for room versions v3
Diffstat (limited to 'synapse/handlers/message.py')
-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 37a7dca794..3981fe69ce 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -745,7 +745,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, @@ -759,6 +760,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: |