Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Jun 27, 2019
1 parent 82028d7 commit 729f5a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 4 additions & 4 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,9 +1089,9 @@ def _generate_sync_entry_for_device_list(
# for anymore.
#
# For the first step we check:
# 1. if any users we share a room with have updated their devices,
# a. if any users we share a room with have updated their devices,
# and
# 2. we also check if we've joined any new rooms, or if a user has
# b. we also check if we've joined any new rooms, or if a user has
# joined a room we're in.
#
# For the second step we just find any users we no longer share a
Expand All @@ -1102,12 +1102,12 @@ def _generate_sync_entry_for_device_list(
user_id
)

# Step 1, check for changes in devices of users we share a room with
# Step 1a, check for changes in devices of users we share a room with
users_that_have_changed = yield self.store.get_users_whose_devices_changed(
since_token.device_list_key, users_who_share_room
)

# Step 2, check for newly joined rooms
# Step 1b, check for newly joined rooms
for room_id in newly_joined_rooms:
joined_users = yield self.state.get_current_users_in_room(room_id)
newly_joined_or_invited_users.update(joined_users)
Expand Down
4 changes: 1 addition & 3 deletions synapse/storage/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,7 @@ def _get_users_whose_devices_changed_txn(txn):
"""

for chunk in batch_iter(to_check, 100):
txn.execute(
sql % (",".join("?" for _ in chunk),), [from_key] + list(chunk)
)
txn.execute(sql % (",".join("?" for _ in chunk),), (from_key,) + chunk)
changes.update(user_id for user_id, in txn)

return changes
Expand Down

0 comments on commit 729f5a4

Please sign in to comment.