summary refs log tree commit diff
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-08-27 16:42:33 +0100
committerKegan Dougal <kegan@matrix.org>2014-08-27 16:42:33 +0100
commit4e8d19ee2ba760ac366f89743b873df15d8e1def (patch)
treeb8794f750a325fd808d07ac162a4726901733619
parentHighlight the current room in the recents list (diff)
downloadsynapse-4e8d19ee2ba760ac366f89743b873df15d8e1def.tar.xz
Added RestServlet for /rooms/$roomid/state
-rw-r--r--synapse/rest/room.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/synapse/rest/room.py b/synapse/rest/room.py
index 3f2530b141..2d30eeaf38 100644
--- a/synapse/rest/room.py
+++ b/synapse/rest/room.py
@@ -322,6 +322,21 @@ class RoomMessageListRestServlet(RestServlet):
         defer.returnValue((200, msgs))
 
 
+# TODO: Needs unit testing
+class RoomStateRestServlet(RestServlet):
+    PATTERN = client_path_pattern("/rooms/(?P<room_id>[^/]*)/state$")
+
+    @defer.inlineCallbacks
+    def on_GET(self, request, room_id):
+        user = yield self.auth.get_user_by_req(request)
+        # TODO: Get all the current state for this room and return in the same
+        # format as initial sync, that is:
+        # [
+        #   { state event }, { state event }
+        # ]
+        defer.returnValue((200, []))
+
+
 class RoomTriggerBackfill(RestServlet):
     PATTERN = client_path_pattern("/rooms/(?P<room_id>[^/]*)/backfill$")
 
@@ -436,3 +451,4 @@ def register_servlets(hs, http_server):
     RoomMembershipRestServlet(hs).register(http_server)
     RoomSendEventRestServlet(hs).register(http_server)
     PublicRoomListRestServlet(hs).register(http_server)
+    RoomStateRestServlet(hs).register(http_server)