From f7a3ebe44d24e18c79847104f103a07f4a575a5f Mon Sep 17 00:00:00 2001 From: Hanadi Date: Thu, 21 Mar 2024 21:05:54 +0300 Subject: Fix reject knocks on deactivating account (#17010) --- synapse/storage/databases/main/roommember.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'synapse/storage') 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]: -- cgit 1.4.1