diff options
author | Kegan Dougal <kegan@matrix.org> | 2014-08-13 11:57:49 +0100 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2014-08-13 11:57:49 +0100 |
commit | 9b3702c9240ed533ccf9f08ba666103234a53c6c (patch) | |
tree | 06629d0e0806a08e8d2fea7c8faf49c2c4364088 /synapse/storage/room.py | |
parent | Room: Added a text input to type an image URL in order to send an image message (diff) | |
download | synapse-9b3702c9240ed533ccf9f08ba666103234a53c6c.tar.xz |
Return the room_alias when GETing public rooms.
Diffstat (limited to 'synapse/storage/room.py')
-rw-r--r-- | synapse/storage/room.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/storage/room.py b/synapse/storage/room.py index 09d9c2339b..a97162831b 100644 --- a/synapse/storage/room.py +++ b/synapse/storage/room.py @@ -93,7 +93,10 @@ class RoomStore(SQLBaseStore): latest_topic = ("SELECT max(room_data.id) FROM room_data WHERE " + "room_data.type = ? GROUP BY room_id") - query = ("SELECT rooms.*, room_data.content FROM rooms LEFT JOIN " + query = ("SELECT rooms.*, room_data.content, room_alias FROM rooms " + + "LEFT JOIN " + + "room_aliases ON room_aliases.room_id = rooms.room_id " + + "LEFT JOIN " + "room_data ON rooms.room_id = room_data.room_id WHERE " + "(room_data.id IN (" + latest_topic + ") " + "OR room_data.id IS NULL) AND rooms.is_public = ?") @@ -103,7 +106,7 @@ class RoomStore(SQLBaseStore): ) # return only the keys the specification expects - ret_keys = ["room_id", "topic"] + ret_keys = ["room_id", "topic", "room_alias"] # extract topic from the json (icky) FIXME for i, room_row in enumerate(res): |