mirror of
https://github.com/element-hq/synapse
synced 2024-09-12 08:15:11 +00:00
Build a set of who we are interested in first and foremost
This commit is contained in:
parent
e70f398f4a
commit
68ecfc346b
1 changed files with 9 additions and 9 deletions
|
@ -300,17 +300,17 @@ class E2eKeysHandler:
|
|||
# queries. We use the more efficient batched query_client_keys for all
|
||||
# remaining users
|
||||
user_ids_updated = []
|
||||
for (user_id, device_list) in destination_query.items():
|
||||
if user_id in user_ids_updated:
|
||||
continue
|
||||
|
||||
if device_list:
|
||||
continue
|
||||
|
||||
room_ids = await self.store.get_rooms_for_user(user_id)
|
||||
if not room_ids:
|
||||
continue
|
||||
# Perform a user device resync for each user only once and only as long as:
|
||||
# - they have an empty device_list
|
||||
# - they are in some rooms that this server can see
|
||||
users_to_resync_devices = {
|
||||
user_id
|
||||
for (user_id, device_list) in destination_query.items()
|
||||
if (not device_list) and (await self.store.get_rooms_for_user(user_id))
|
||||
}
|
||||
|
||||
for user_id in users_to_resync_devices:
|
||||
# We've decided we're sharing a room with this user and should
|
||||
# probably be tracking their device lists. However, we haven't
|
||||
# done an initial sync on the device list so we do it now.
|
||||
|
|
Loading…
Reference in a new issue