summary refs log tree commit diff
path: root/synapse/rest/room.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-08-27 14:51:59 +0100
committerKegan Dougal <kegan@matrix.org>2014-08-27 14:52:07 +0100
commit1d9d287c7c9e1149561e2e4b9623a74823f441db (patch)
tree36b8ec704a7a7f4e8413bb8cc877f2a4a9002142 /synapse/rest/room.py
parentfix joining rooms on webclient (diff)
downloadsynapse-1d9d287c7c9e1149561e2e4b9623a74823f441db.tar.xz
Renamed /public/rooms to /publicRooms
Diffstat (limited to 'synapse/rest/room.py')
-rw-r--r--synapse/rest/room.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/rest/room.py b/synapse/rest/room.py
index 1cbb31e301..3f2530b141 100644
--- a/synapse/rest/room.py
+++ b/synapse/rest/room.py
@@ -265,6 +265,17 @@ class JoinRoomAliasServlet(RestServlet):
 
 
 # TODO: Needs unit testing
+class PublicRoomListRestServlet(RestServlet):
+    PATTERN = client_path_pattern("/publicRooms$")
+
+    @defer.inlineCallbacks
+    def on_GET(self, request):
+        handler = self.handlers.room_list_handler
+        data = yield handler.get_public_room_list()
+        defer.returnValue((200, data))
+
+
+# TODO: Needs unit testing
 class RoomMemberListRestServlet(RestServlet):
     PATTERN = client_path_pattern("/rooms/(?P<room_id>[^/]*)/members$")
 
@@ -424,3 +435,4 @@ def register_servlets(hs, http_server):
     RoomTriggerBackfill(hs).register(http_server)
     RoomMembershipRestServlet(hs).register(http_server)
     RoomSendEventRestServlet(hs).register(http_server)
+    PublicRoomListRestServlet(hs).register(http_server)