Skip to content
Snippets Groups Projects
Unverified Commit 58af30a6 authored by Erik Johnston's avatar Erik Johnston Committed by GitHub
Browse files

Merge pull request #5802 from matrix-org/erikj/deny_redacting_different_room

Deny redaction of events in a different room.
parents 0f632f3a 0eefb76f
No related branches found
No related tags found
No related merge requests found
Deny redactions of events sent in a different room.
......@@ -795,7 +795,6 @@ class EventCreationHandler(object):
get_prev_content=False,
allow_rejected=False,
allow_none=True,
check_room_id=event.room_id,
)
# we can make some additional checks now if we have the original event.
......@@ -803,6 +802,9 @@ class EventCreationHandler(object):
if original_event.type == EventTypes.Create:
raise AuthError(403, "Redacting create events is not permitted")
if original_event.room_id != event.room_id:
raise SynapseError(400, "Cannot redact event from a different room")
prev_state_ids = yield context.get_prev_state_ids(self.store)
auth_events_ids = yield self.auth.compute_auth_events(
event, prev_state_ids, for_verification=True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment