diff options
author | Erik Johnston <erikj@jki.re> | 2019-01-29 10:55:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-29 10:55:07 +0000 |
commit | 073f6c2e5eefbaf64fcec9b8b98a029193d5e25d (patch) | |
tree | 7dbfb2e2bd21214c223468a0de3796c048e5da2b /synapse/handlers/federation.py | |
parent | Fix receiving events from federation via a worker (diff) | |
parent | Remove duplicate checks (diff) | |
download | synapse-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/federation.py')
-rw-r--r-- | synapse/handlers/federation.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 5adbe7b538..adf59db7a8 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -2282,7 +2282,7 @@ class FederationHandler(BaseHandler): room_version = yield self.store.get_room_version(room_id) builder = self.event_builder_factory.new(room_version, event_dict) - EventValidator().validate_new(builder) + EventValidator().validate_builder(builder) event, context = yield self.event_creation_handler.create_new_client_event( builder=builder ) @@ -2291,6 +2291,8 @@ class FederationHandler(BaseHandler): room_version, event_dict, event, context ) + EventValidator().validate_new(event) + try: yield self.auth.check_from_context(room_version, event, context) except AuthError as e: @@ -2376,10 +2378,11 @@ class FederationHandler(BaseHandler): # auth check code will explode appropriately. builder = self.event_builder_factory.new(room_version, event_dict) - EventValidator().validate_new(builder) + EventValidator().validate_builder(builder) event, context = yield self.event_creation_handler.create_new_client_event( builder=builder, ) + EventValidator().validate_new(event) defer.returnValue((event, context)) @defer.inlineCallbacks |