Only work out newly_joined_users for incremental sync

pull/800/head
Erik Johnston 2016-05-24 11:21:34 +01:00
parent b08ad0389e
commit 1c5ed2a19b
1 changed files with 9 additions and 6 deletions

View File

@ -699,12 +699,15 @@ class SyncHandler(object):
# Now we want to get any newly joined users # Now we want to get any newly joined users
newly_joined_users = set() newly_joined_users = set()
for joined_sync in sync_result_builder.joined: if sync_result_builder.since_token:
it = itertools.chain(joined_sync.timeline.events, joined_sync.state.values()) for joined_sync in sync_result_builder.joined:
for event in it: it = itertools.chain(
if event.type == EventTypes.Member: joined_sync.timeline.events, joined_sync.state.values()
if event.membership == Membership.JOIN: )
newly_joined_users.add(event.state_key) 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)) defer.returnValue((newly_joined_rooms, newly_joined_users))