summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-11-17 16:37:33 +0000
committerMark Haines <mark.haines@matrix.org>2014-11-17 16:37:33 +0000
commitcf45e57d9cf52a12e61141cf63789d61491ea425 (patch)
tree09cfd71d2cd03bcc10a20c8388a31f2baf59b992 /synapse/handlers
parentMark synapse as not zip-safe since it needs to be able to read schema files f... (diff)
downloadsynapse-cf45e57d9cf52a12e61141cf63789d61491ea425.tar.xz
SYN-148: Add the alias after creating the room
Diffstat (limited to '')
-rw-r--r--synapse/handlers/room.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 825957f721..cfe1061ed3 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -111,15 +111,6 @@ class RoomCreationHandler(BaseHandler):
             user, room_id, is_public=is_public
         )
 
-        if room_alias:
-            directory_handler = self.hs.get_handlers().directory_handler
-            yield directory_handler.create_association(
-                user_id=user_id,
-                room_id=room_id,
-                room_alias=room_alias,
-                servers=[self.hs.hostname],
-            )
-
         @defer.inlineCallbacks
         def handle_event(event):
             snapshot = yield self.store.snapshot_room(event)
@@ -184,9 +175,18 @@ class RoomCreationHandler(BaseHandler):
             join_event,
             do_auth=False
         )
+
         result = {"room_id": room_id}
+
         if room_alias:
             result["room_alias"] = room_alias.to_string()
+            directory_handler = self.hs.get_handlers().directory_handler
+            yield directory_handler.create_association(
+                user_id=user_id,
+                room_id=room_id,
+                room_alias=room_alias,
+                servers=[self.hs.hostname],
+            )
 
         defer.returnValue(result)