summary refs log tree commit diff
path: root/synapse/storage/directory.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-02-25 17:37:14 +0000
committerKegan Dougal <kegan@matrix.org>2015-02-25 17:37:14 +0000
commit2c79c4dc7f638f1cb823903a2f8bb1005fda4a2c (patch)
treec82a5ce3dd31c6aea8d2d01533fe89f8853ebb37 /synapse/storage/directory.py
parentAdd support for extracting matching room_ids and room_aliases for a given AS. (diff)
downloadsynapse-2c79c4dc7f638f1cb823903a2f8bb1005fda4a2c.tar.xz
Fix alias query.
Diffstat (limited to 'synapse/storage/directory.py')
-rw-r--r--synapse/storage/directory.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/synapse/storage/directory.py b/synapse/storage/directory.py
index e13b336934..70c8c8ccd3 100644
--- a/synapse/storage/directory.py
+++ b/synapse/storage/directory.py
@@ -141,20 +141,19 @@ class DirectoryStore(SQLBaseStore):
         Returns:
             A list of RoomAliasMappings.
         """
-        results = self._simple_select_list(
-            "room_aliases",
-            None,
-            ["room_alias", "room_id"]
+        results = yield self._execute_and_decode(
+            "SELECT room_id, room_alias FROM room_aliases"
         )
+
         # TODO(kegan): It feels wrong to be specifying no servers here, but
         # equally this function isn't required to obtain all servers so
         # retrieving them "just for the sake of it" also seems wrong, but we
         # want to conform to passing Objects around and not dicts..
-        return [
+        defer.returnValue([
             RoomAliasMapping(
                 room_id=r["room_id"], room_alias=r["room_alias"], servers=""
             ) for r in results
-        ]
+        ])
 
 
     def get_aliases_for_room(self, room_id):