summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/message.py6
-rw-r--r--synapse/handlers/room.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py

index 393f17c3a3..9919cccb19 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py
@@ -1108,7 +1108,7 @@ class EventCreationHandler: # it's not a self-redaction (to avoid having to look up whether the # user is actually admin or not). is_admin_redaction = False - if event.type == EventTypes.Redaction: + if event.type == EventTypes.Redaction and event.redacts: original_event = await self.store.get_event( event.redacts, redact_behaviour=EventRedactBehaviour.AS_IS, @@ -1195,7 +1195,7 @@ class EventCreationHandler: # TODO: Make sure the signatures actually are correct. event.signatures.update(returned_invite.signatures) - if event.type == EventTypes.Redaction: + if event.type == EventTypes.Redaction and event.redacts: original_event = await self.store.get_event( event.redacts, redact_behaviour=EventRedactBehaviour.AS_IS, @@ -1401,7 +1401,7 @@ class EventCreationHandler: ] for k in immutable_fields: - if getattr(builder, k, None) != original_event.get(k): + if getattr(builder, k, None) != getattr(original_event, k, None): raise Exception( "Third party rules module created an invalid event: " "cannot change field " + k diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index fb4823a5cc..0b805af60c 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py
@@ -475,7 +475,7 @@ class RoomCreationHandler(BaseHandler): ): await self.room_member_handler.update_membership( requester, - UserID.from_string(old_event["state_key"]), + UserID.from_string(old_event.state_key), new_room_id, "ban", ratelimit=False,