summary refs log tree commit diff
path: root/synapse/handlers/message.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r--synapse/handlers/message.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index d8f8ea80cc..b77d9d1644 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -293,3 +293,25 @@ class MessageHandler(BaseHandler):
         }
 
         defer.returnValue(ret)
+
+    @defer.inlineCallbacks
+    def snapshot_room(self, user_id, room_id, pagin_config=None,
+                      feedback=False):
+        yield self.auth.check_joined_room(room_id, user_id)
+
+        # TODO: These concurrently
+        state_tuples = yield self.store.get_current_state(room_id)
+        state = [self.hs.serialize_event(x) for x in state_tuples]
+
+        member_event = (yield self.store.get_room_member(
+            user_id=user_id,
+            room_id=room_id
+        ))
+
+        defer.returnValue({
+            "membership": member_event.membership,
+            "room_id": room_id,
+            #"messages": messages,
+            "state": state,
+            #"presence": presence
+        })