diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-11-18 15:48:30 +0000 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-11-18 15:48:30 +0000 |
commit | e9f587ecbaf5b60183d7c56108d76bb5f76a98f4 (patch) | |
tree | 5cf7df273b613b88902016722ca8f2d1c222cf19 /synapse/handlers/directory.py | |
parent | Include room members' presence in room initialSync (diff) | |
parent | Null check when determining default power levels (diff) | |
download | synapse-e9f587ecbaf5b60183d7c56108d76bb5f76a98f4.tar.xz |
Merge remote-tracking branch 'origin/develop' into room-initial-sync
Diffstat (limited to 'synapse/handlers/directory.py')
-rw-r--r-- | synapse/handlers/directory.py | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py index 164363cdc5..98ac0684fc 100644 --- a/synapse/handlers/directory.py +++ b/synapse/handlers/directory.py @@ -21,8 +21,6 @@ from synapse.api.errors import SynapseError from synapse.api.events.room import RoomAliasesEvent import logging -import sqlite3 - logger = logging.getLogger(__name__) @@ -56,17 +54,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 +128,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( |