Skip to content
Snippets Groups Projects
Commit 9b3702c9 authored by Kegan Dougal's avatar Kegan Dougal
Browse files

Return the room_alias when GETing public rooms.

parent c87e1f64
No related branches found
No related tags found
No related merge requests found
...@@ -93,7 +93,10 @@ class RoomStore(SQLBaseStore): ...@@ -93,7 +93,10 @@ class RoomStore(SQLBaseStore):
latest_topic = ("SELECT max(room_data.id) FROM room_data WHERE " latest_topic = ("SELECT max(room_data.id) FROM room_data WHERE "
+ "room_data.type = ? GROUP BY room_id") + "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 ON rooms.room_id = room_data.room_id WHERE "
+ "(room_data.id IN (" + latest_topic + ") " + "(room_data.id IN (" + latest_topic + ") "
+ "OR room_data.id IS NULL) AND rooms.is_public = ?") + "OR room_data.id IS NULL) AND rooms.is_public = ?")
...@@ -103,7 +106,7 @@ class RoomStore(SQLBaseStore): ...@@ -103,7 +106,7 @@ class RoomStore(SQLBaseStore):
) )
# return only the keys the specification expects # 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 # extract topic from the json (icky) FIXME
for i, room_row in enumerate(res): for i, room_row in enumerate(res):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment