summary refs log tree commit diff
path: root/synapse/handlers/message.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-05-05 16:37:37 +0100
committerErik Johnston <erik@matrix.org>2021-05-05 16:37:37 +0100
commit015fdfe5bb090d30f25fe97fc3fc41d8863418dc (patch)
tree9475cd81546630a79d31457857374a21a42f0156 /synapse/handlers/message.py
parentFix log contexts (diff)
parentMore ensmalling (diff)
downloadsynapse-015fdfe5bb090d30f25fe97fc3fc41d8863418dc.tar.xz
Merge branch 'erikj/smaller_events' into erikj/test_send
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r--synapse/handlers/message.py6
1 files changed, 3 insertions, 3 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