summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--changelog.d/13960.misc1
-rw-r--r--synapse/handlers/room_member.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/changelog.d/13960.misc b/changelog.d/13960.misc
new file mode 100644
index 0000000000..a7ba532bcb
--- /dev/null
+++ b/changelog.d/13960.misc
@@ -0,0 +1 @@
+Use dedicated `get_local_users_in_room(room_id)` function to find local users when calculating users to copy over during a room upgrade.
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py
index 88158822e0..ee669eb30f 100644
--- a/synapse/handlers/room_member.py
+++ b/synapse/handlers/room_member.py
@@ -1150,8 +1150,8 @@ class RoomMemberHandler(metaclass=abc.ABCMeta):
         logger.info("Transferring room state from %s to %s", old_room_id, room_id)
 
         # Find all local users that were in the old room and copy over each user's state
-        users = await self.store.get_users_in_room(old_room_id)
-        await self.copy_user_state_on_room_upgrade(old_room_id, room_id, users)
+        local_users = await self.store.get_local_users_in_room(old_room_id)
+        await self.copy_user_state_on_room_upgrade(old_room_id, room_id, local_users)
 
         # Add new room to the room directory if the old room was there
         # Remove old room from the room directory