diff options
author | Erik Johnston <erik@matrix.org> | 2016-05-24 11:21:34 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-05-24 11:21:34 +0100 |
commit | 1c5ed2a19ba6da4478c54df072e623598c0ea60d (patch) | |
tree | 1679db9edba6807b7c1d9b7b3c811fd27812262a /synapse/handlers | |
parent | Only include non-offline presence in initial sync (diff) | |
download | synapse-1c5ed2a19ba6da4478c54df072e623598c0ea60d.tar.xz |
Only work out newly_joined_users for incremental sync
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/sync.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index 8143171c11..476dcf38e2 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -699,12 +699,15 @@ class SyncHandler(object): # Now we want to get any newly joined users newly_joined_users = set() - for joined_sync in sync_result_builder.joined: - it = itertools.chain(joined_sync.timeline.events, joined_sync.state.values()) - for event in it: - if event.type == EventTypes.Member: - if event.membership == Membership.JOIN: - newly_joined_users.add(event.state_key) + if sync_result_builder.since_token: + for joined_sync in sync_result_builder.joined: + it = itertools.chain( + joined_sync.timeline.events, joined_sync.state.values() + ) + for event in it: + if event.type == EventTypes.Member: + if event.membership == Membership.JOIN: + newly_joined_users.add(event.state_key) defer.returnValue((newly_joined_rooms, newly_joined_users)) |