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

Commit

Permalink
Only send out device list updates for our own users
Browse files Browse the repository at this point in the history
Broke in #12365
  • Loading branch information
erikjohnston committed Apr 13, 2022
1 parent 0922462 commit 7fee8fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 7 additions & 3 deletions synapse/handlers/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,13 @@ async def _handle_new_device_update_async(self) -> None:
return

for user_id, device_id, room_id, stream_id, opentracing_context in rows:
joined_user_ids = await self.store.get_users_in_room(room_id)
hosts = {get_domain_from_id(u) for u in joined_user_ids}
hosts.discard(self.server_name)
hosts = set()

# Ignore any users that aren't ours
if self.hs.is_mine_id(user_id):
joined_user_ids = await self.store.get_users_in_room(room_id)
hosts = {get_domain_from_id(u) for u in joined_user_ids}
hosts.discard(self.server_name)

# Check if we've already sent this update to some hosts
if current_stream_id == stream_id:
Expand Down
4 changes: 3 additions & 1 deletion synapse/storage/databases/main/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,9 @@ def _add_device_outbound_poke_to_stream_txn(
next(stream_id_iterator),
user_id,
device_id,
False,
not self.hs.is_mine_id(
user_id
), # We only need to send out update for *our* users
now,
encoded_context if whitelisted_homeserver(destination) else "{}",
)
Expand Down

0 comments on commit 7fee8fe

Please sign in to comment.