summary refs log tree commit diff
path: root/synapse/handlers/message.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2019-01-29 10:55:07 +0000
committerGitHub <noreply@github.com>2019-01-29 10:55:07 +0000
commit073f6c2e5eefbaf64fcec9b8b98a029193d5e25d (patch)
tree7dbfb2e2bd21214c223468a0de3796c048e5da2b /synapse/handlers/message.py
parentFix receiving events from federation via a worker (diff)
parentRemove duplicate checks (diff)
downloadsynapse-073f6c2e5eefbaf64fcec9b8b98a029193d5e25d.tar.xz
Merge pull request #4494 from matrix-org/erikj/fixup_event_validator
Split up event validation between event and builder
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r--synapse/handlers/message.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 67b364a6c3..05d1370c18 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -288,7 +288,7 @@ class EventCreationHandler(object):
 
         builder = self.event_builder_factory.new(room_version, event_dict)
 
-        self.validator.validate_new(builder)
+        self.validator.validate_builder(builder)
 
         if builder.type == EventTypes.Member:
             membership = builder.content.get("membership", None)
@@ -326,6 +326,8 @@ class EventCreationHandler(object):
             prev_events_and_hashes=prev_events_and_hashes,
         )
 
+        self.validator.validate_new(event)
+
         defer.returnValue((event, context))
 
     def _is_exempt_from_privacy_policy(self, builder, requester):