summary refs log tree commit diff
path: root/synapse/federation/transport/client.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-08-04 15:29:45 +0100
committerErik Johnston <erik@matrix.org>2016-08-04 15:29:45 +0100
commitb3682df2ca0673d703e05fdbfc43b79a61517948 (patch)
tree79275cc75a3b5b56ce44f3750821f66ab5f89db0 /synapse/federation/transport/client.py
parentDon't infer paragrahs from newlines (diff)
parentMerge pull request #979 from matrix-org/erikj/state_ids_api (diff)
downloadsynapse-b3682df2ca0673d703e05fdbfc43b79a61517948.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/xpath_fix
Diffstat (limited to 'synapse/federation/transport/client.py')
-rw-r--r--synapse/federation/transport/client.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/synapse/federation/transport/client.py b/synapse/federation/transport/client.py
index ebb698e278..3d088e43cb 100644
--- a/synapse/federation/transport/client.py
+++ b/synapse/federation/transport/client.py
@@ -55,6 +55,28 @@ class TransportLayerClient(object):
         )
 
     @log_function
+    def get_room_state_ids(self, destination, room_id, event_id):
+        """ Requests all state for a given room from the given server at the
+        given event. Returns the state's event_id's
+
+        Args:
+            destination (str): The host name of the remote home server we want
+                to get the state from.
+            context (str): The name of the context we want the state of
+            event_id (str): The event we want the context at.
+
+        Returns:
+            Deferred: Results in a dict received from the remote homeserver.
+        """
+        logger.debug("get_room_state_ids dest=%s, room=%s",
+                     destination, room_id)
+
+        path = PREFIX + "/state_ids/%s/" % room_id
+        return self.client.get_json(
+            destination, path=path, args={"event_id": event_id},
+        )
+
+    @log_function
     def get_event(self, destination, event_id, timeout=None):
         """ Requests the pdu with give id and origin from the given server.