diff options
author | Andrew Morgan <andrew@amorgan.xyz> | 2019-01-28 14:08:24 +0000 |
---|---|---|
committer | Andrew Morgan <andrew@amorgan.xyz> | 2019-01-28 14:08:24 +0000 |
commit | 4026d555fabe6f00d865a0c63226799e53a092e1 (patch) | |
tree | 9a8211924748e48915e1acf6d097e0bff88a03bb /synapse/handlers/message.py | |
parent | Reuse predecessor method (diff) | |
parent | Remove --process-dependency-links from UPGRADE.rst (#4485) (diff) | |
download | synapse-4026d555fabe6f00d865a0c63226799e53a092e1.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into anoa/dm_room_upgrade
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r-- | synapse/handlers/message.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index a7cd779b02..7aaa4fba33 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -278,7 +278,15 @@ class EventCreationHandler(object): """ yield self.auth.check_auth_blocking(requester.user.to_string()) - builder = self.event_builder_factory.new(event_dict) + if event_dict["type"] == EventTypes.Create and event_dict["state_key"] == "": + room_version = event_dict["content"]["room_version"] + else: + try: + room_version = yield self.store.get_room_version(event_dict["room_id"]) + except NotFoundError: + raise AuthError(403, "Unknown room") + + builder = self.event_builder_factory.new(room_version, event_dict) self.validator.validate_new(builder) |