Add comment to sync as to why code path is split

This commit is contained in:
Erik Johnston 2018-05-09 15:56:07 +01:00
parent e2accd7f1d
commit d26bec8a43
1 changed files with 5 additions and 0 deletions

View File

@ -354,6 +354,11 @@ class SyncHandler(object):
since_key = since_token.room_key
while limited and len(recents) < timeline_limit and max_repeat:
# If we have a since_key then we are trying to get any events
# that have happened since `since_key` up to `end_key`, so we
# can just use `get_room_events_stream_for_room`.
# Otherwise, we want to return the last N events in the room
# in toplogical ordering.
if since_key:
events, end_key = yield self.store.get_room_events_stream_for_room(
room_id,