Update get_users_in_room mis-use to get hosts with dedicated get_current_hosts_in_room (#13605)

See https://github.com/matrix-org/synapse/pull/13575#discussion_r953023755
This commit is contained in:
Eric Eastwood 2022-08-24 14:15:37 -05:00 committed by GitHub
parent d58615c82c
commit 1a209efdb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 17 deletions

View file

@ -310,6 +310,7 @@ class DeviceHandler(DeviceWorkerHandler):
super().__init__(hs)
self.federation_sender = hs.get_federation_sender()
self._storage_controllers = hs.get_storage_controllers()
self.device_list_updater = DeviceListUpdater(hs, self)
@ -694,8 +695,11 @@ class DeviceHandler(DeviceWorkerHandler):
# 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 = set(
await self._storage_controllers.state.get_current_hosts_in_room(
room_id
)
)
hosts.discard(self.server_name)
# Check if we've already sent this update to some hosts