summary refs log tree commit diff
path: root/synapse/handlers/directory.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-11-18 15:03:01 +0000
committerMark Haines <mark.haines@matrix.org>2014-11-18 15:03:13 +0000
commita5b88c489ebf23e076a99306e7c95e9b60e83864 (patch)
tree9e6d493cec26f95f3e92bc83e447589a638f81f7 /synapse/handlers/directory.py
parentwarn about memory (diff)
downloadsynapse-a5b88c489ebf23e076a99306e7c95e9b60e83864.tar.xz
Split out sending the room alias events from creating the alias so that we can do them in the right point when creating a room
Diffstat (limited to 'synapse/handlers/directory.py')
-rw-r--r--synapse/handlers/directory.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py
index 164363cdc5..5d79c6690c 100644
--- a/synapse/handlers/directory.py
+++ b/synapse/handlers/directory.py
@@ -56,17 +56,11 @@ class DirectoryHandler(BaseHandler):
         if not servers:
             raise SynapseError(400, "Failed to get server list")
 
-        try:
-            yield self.store.create_room_alias_association(
-                room_alias,
-                room_id,
-                servers
-            )
-        except sqlite3.IntegrityError:
-            defer.returnValue("Already exists")
-
-        # TODO: Send the room event.
-        yield self._update_room_alias_events(user_id, room_id)
+        yield self.store.create_room_alias_association(
+            room_alias,
+            room_id,
+            servers
+        )
 
     @defer.inlineCallbacks
     def delete_association(self, user_id, room_alias):
@@ -136,7 +130,7 @@ class DirectoryHandler(BaseHandler):
         })
 
     @defer.inlineCallbacks
-    def _update_room_alias_events(self, user_id, room_id):
+    def send_room_alias_update_event(self, user_id, room_id):
         aliases = yield self.store.get_aliases_for_room(room_id)
 
         event = self.event_factory.create_event(