summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2023-10-27 12:50:50 -0400
committerGitHub <noreply@github.com>2023-10-27 12:50:50 -0400
commit2bf934140625e91e1e27ffc9f717f6f2d277b2b9 (patch)
tree3f305b0eb8728414fe4603f4575bea30ae25be67 /synapse/handlers
parentReduce amount of caches POSITIONS we send (#16561) (diff)
downloadsynapse-2bf934140625e91e1e27ffc9f717f6f2d277b2b9.tar.xz
Ensure local invited & knocking users leave before purge. (#16559)
This is mostly useful for federated rooms where some users
would get stuck in the invite or knock state when the room
was purged from their homeserver.
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/room.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 97c9f01245..6d680b0795 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -1939,9 +1939,10 @@ class RoomShutdownHandler:
         else:
             logger.info("Shutting down room %r", room_id)
 
-        users = await self.store.get_users_in_room(room_id)
-        for user_id in users:
-            if not self.hs.is_mine_id(user_id):
+        users = await self.store.get_local_users_related_to_room(room_id)
+        for user_id, membership in users:
+            # If the user is not in the room (or is banned), nothing to do.
+            if membership not in (Membership.JOIN, Membership.INVITE, Membership.KNOCK):
                 continue
 
             logger.info("Kicking %r from %r...", user_id, room_id)