From 9b3702c9240ed533ccf9f08ba666103234a53c6c Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 13 Aug 2014 11:57:49 +0100 Subject: [PATCH] Return the room_alias when GETing public rooms. --- synapse/storage/room.py | 7 +++++-- 1 file 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):