summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2014-11-17 11:11:15 -0800
committerMatthew Hodgson <matthew@matrix.org>2014-11-17 11:11:15 -0800
commitd18fc97717d607a2c89327c9c2b60c1d83692d89 (patch)
tree852d51a7ec15e3534c26cdcd3d66373525519370
parentclarify install instructions further still (diff)
parentSYN-148: Add the alias after creating the room (diff)
downloadsynapse-d18fc97717d607a2c89327c9c2b60c1d83692d89.tar.xz
Merge branch 'develop' of git+ssh://github.com/matrix-org/synapse into develop
-rwxr-xr-xsetup.py1
-rw-r--r--synapse/handlers/room.py18
2 files changed, 10 insertions, 9 deletions
diff --git a/setup.py b/setup.py
index 68b2655d6b..ed21799e72 100755
--- a/setup.py
+++ b/setup.py
@@ -54,6 +54,7 @@ setup(
         "mock"
     ],
     include_package_data=True,
+    zip_safe=False,
     long_description=read("README.rst"),
     entry_points="""
     [console_scripts]
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)