summary refs log tree commit diff
path: root/synapse/federation/federation_client.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-03-02 14:54:27 +0000
committerErik Johnston <erik@matrix.org>2015-03-02 14:54:27 +0000
commitb2d211847651414d67d4935683e32c76eb944029 (patch)
tree25ca81b14a72192a89c9399b3d80180ac124ca14 /synapse/federation/federation_client.py
parentMerge pull request #83 from matrix-org/nofile_limit_config (diff)
parentMerge branch 'develop' of github.com:matrix-org/synapse into batched_get_pdu (diff)
downloadsynapse-b2d211847651414d67d4935683e32c76eb944029.tar.xz
Merge pull request #88 from matrix-org/batched_get_pdu
Batched get pdu
Diffstat (limited to 'synapse/federation/federation_client.py')
-rw-r--r--synapse/federation/federation_client.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/synapse/federation/federation_client.py b/synapse/federation/federation_client.py
index cd3c962d50..ca89a0787c 100644
--- a/synapse/federation/federation_client.py
+++ b/synapse/federation/federation_client.py
@@ -439,6 +439,25 @@ class FederationClient(FederationBase):
 
         defer.returnValue(ret)
 
+    @defer.inlineCallbacks
+    def get_missing_events(self, destination, room_id, earliest_events,
+                           latest_events, limit, min_depth):
+        content = yield self.transport_layer.get_missing_events(
+            destination, room_id, earliest_events, latest_events, limit,
+            min_depth,
+        )
+
+        events = [
+            self.event_from_pdu_json(e)
+            for e in content.get("events", [])
+        ]
+
+        signed_events = yield self._check_sigs_and_hash_and_fetch(
+            destination, events, outlier=True
+        )
+
+        defer.returnValue(signed_events)
+
     def event_from_pdu_json(self, pdu_json, outlier=False):
         event = FrozenEvent(
             pdu_json