diff options
author | Erik Johnston <erik@matrix.org> | 2015-03-05 16:42:15 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-03-05 16:42:15 +0000 |
commit | 12bcf3d1790db891b407284eba60e7b2da3a471c (patch) | |
tree | c0bcd44fc78a90f6d7b4c603cd31cea8eeda71d0 /synapse/federation/federation_server.py | |
parent | Slightly reduce the insane amounts of indentation in main http server respons... (diff) | |
parent | Docs (diff) | |
download | synapse-12bcf3d1790db891b407284eba60e7b2da3a471c.tar.xz |
Merge pull request #100 from matrix-org/missing_pdu_compat
Handle if get_missing_pdu returns 400 or not all events.
Diffstat (limited to 'synapse/federation/federation_server.py')
-rw-r--r-- | synapse/federation/federation_server.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py index 4264d857be..9c7dcdba96 100644 --- a/synapse/federation/federation_server.py +++ b/synapse/federation/federation_server.py @@ -413,12 +413,16 @@ class FederationServer(FederationBase): missing_events = yield self.get_missing_events( origin, pdu.room_id, - earliest_events=list(latest), - latest_events=[pdu.event_id], + earliest_events_ids=list(latest), + latest_events=[pdu], limit=10, min_depth=min_depth, ) + # We want to sort these by depth so we process them and + # tell clients about them in order. + missing_events.sort(key=lambda x: x.depth) + for e in missing_events: yield self._handle_new_pdu( origin, |