summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorHanadi <hanadi.tamimi@gmail.com>2024-03-21 21:05:54 +0300
committerGitHub <noreply@github.com>2024-03-21 18:05:54 +0000
commitf7a3ebe44d24e18c79847104f103a07f4a575a5f (patch)
treeb1e27671f2d1e0872ca50b70f53fea8e48766235 /synapse/storage
parentgenerate configuration with correct user in start.py for docker (#16978) (diff)
downloadsynapse-f7a3ebe44d24e18c79847104f103a07f4a575a5f.tar.xz
Fix reject knocks on deactivating account (#17010)
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/databases/main/roommember.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/synapse/storage/databases/main/roommember.py b/synapse/storage/databases/main/roommember.py
index 5b0daffa46..5d51502595 100644
--- a/synapse/storage/databases/main/roommember.py
+++ b/synapse/storage/databases/main/roommember.py
@@ -369,6 +369,22 @@ class RoomMemberWorkerStore(EventsWorkerStore, CacheInvalidationWorkerStore):
             user_id, [Membership.INVITE]
         )
 
+    async def get_knocked_at_rooms_for_local_user(
+        self, user_id: str
+    ) -> Sequence[RoomsForUser]:
+        """Get all the rooms the *local* user has knocked at.
+
+        Args:
+            user_id: The user ID.
+
+        Returns:
+            A list of RoomsForUser.
+        """
+
+        return await self.get_rooms_for_local_user_where_membership_is(
+            user_id, [Membership.KNOCK]
+        )
+
     async def get_invite_for_local_user_in_room(
         self, user_id: str, room_id: str
     ) -> Optional[RoomsForUser]: