summary refs log tree commit diff
path: root/synapse/handlers/device.py
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2022-08-24 14:15:37 -0500
committerGitHub <noreply@github.com>2022-08-24 14:15:37 -0500
commit1a209efdb2a6c51e52dd277de7581099852877ae (patch)
tree7a958e50f974ef92f02d2223c53c9085b81a4aae /synapse/handlers/device.py
parentDirectly lookup local membership instead of getting all members in a room fir... (diff)
downloadsynapse-1a209efdb2a6c51e52dd277de7581099852877ae.tar.xz
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
Diffstat (limited to 'synapse/handlers/device.py')
-rw-r--r--synapse/handlers/device.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py
index f5c586f657..9c2c3a0e68 100644
--- a/synapse/handlers/device.py
+++ b/synapse/handlers/device.py
@@ -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