Split a storage function in two so that we don't have to do extra work.

This commit is contained in:
Erik Johnston 2015-05-01 10:17:19 +01:00
parent 8be5284e91
commit 23c639ff32
3 changed files with 14 additions and 8 deletions

View file

@ -417,13 +417,13 @@ class FederationServer(FederationBase):
pdu.internal_metadata.outlier = True
elif min_depth and pdu.depth > min_depth:
if get_missing and prevs - seen:
latest_tuples = yield self.store.get_latest_events_in_room(
latest = yield self.store.get_latest_event_ids_in_room(
pdu.room_id
)
# We add the prev events that we have seen to the latest
# list to ensure the remote server doesn't give them to us
latest = set(e_id for e_id, _, _ in latest_tuples)
latest = set(latest)
latest |= seen
missing_events = yield self.get_missing_events(