diff options
author | Erik Johnston <erik@matrix.org> | 2014-09-05 21:35:56 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-09-05 21:35:56 +0100 |
commit | 9dd4570b68fea123fda216b8fc8625fafc9d8e0a (patch) | |
tree | bf87c16f720a7ad34d29d4b2a8b462506c919624 /synapse/rest | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into develop (diff) | |
download | synapse-9dd4570b68fea123fda216b8fc8625fafc9d8e0a.tar.xz |
Generate m.room.aliases event when the HS creates a room alias
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/directory.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/rest/directory.py b/synapse/rest/directory.py index 18df7c8d8b..31849246a1 100644 --- a/synapse/rest/directory.py +++ b/synapse/rest/directory.py @@ -45,6 +45,8 @@ class ClientDirectoryServer(RestServlet): @defer.inlineCallbacks def on_PUT(self, request, room_alias): + user = yield self.auth.get_user_by_req(request) + content = _parse_json(request) if not "room_id" in content: raise SynapseError(400, "Missing room_id key", @@ -69,12 +71,13 @@ class ClientDirectoryServer(RestServlet): try: yield dir_handler.create_association( - room_alias, room_id, servers + user.to_string(), room_alias, room_id, servers ) except SynapseError as e: raise e except: logger.exception("Failed to create association") + raise defer.returnValue((200, {})) |