diff options
author | Erik Johnston <erik@matrix.org> | 2016-08-03 14:52:43 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-08-03 14:52:43 +0100 |
commit | a60a2eaa02f454dbc450cf821f6cd1c6b0b93993 (patch) | |
tree | 1e07d2d7fdcae6fa7b30a1172073a060279a1420 /synapse/federation | |
parent | Add /state_ids federation API (diff) | |
download | synapse-a60a2eaa02f454dbc450cf821f6cd1c6b0b93993.tar.xz |
Comment
Diffstat (limited to 'synapse/federation')
-rw-r--r-- | synapse/federation/federation_client.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/federation/federation_client.py b/synapse/federation/federation_client.py index 03f6133e61..0491f1c3fe 100644 --- a/synapse/federation/federation_client.py +++ b/synapse/federation/federation_client.py @@ -364,6 +364,20 @@ class FederationClient(FederationBase): @defer.inlineCallbacks def get_events(self, destinations, room_id, event_ids, return_local=True): + """Fetch events from some remote destinations, checking if we already + have them. + + Args: + destinations (list) + room_id (str) + event_ids (list) + return_local (bool): Whether to include events we already have in + the DB in the returned list of events + + Returns: + Deferred: A deferred resolving to a 2-tuple where the first is a list of + events and the second is a list of event ids that we failed to fetch. + """ if return_local: seen_events = yield self.store.get_events(event_ids) signed_events = seen_events.values() |