diff options
author | reivilibre <oliverw@matrix.org> | 2022-09-14 15:53:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-14 15:53:18 +0000 |
commit | 6302753012927b63feddc71dd287e2d3554707d4 (patch) | |
tree | f6ef20890b30492f604a3ac2e4e9d7b8daa87a9b /synapse/handlers/room_member.py | |
parent | Fix a memory leak when running the unit tests. (#13798) (diff) | |
download | synapse-6302753012927b63feddc71dd287e2d3554707d4.tar.xz |
Deduplicate `is_server_notices_room`. (#13780)
Diffstat (limited to 'synapse/handlers/room_member.py')
-rw-r--r-- | synapse/handlers/room_member.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py index 5d4adf5bfd..8d01f4bf2b 100644 --- a/synapse/handlers/room_member.py +++ b/synapse/handlers/room_member.py @@ -837,7 +837,7 @@ class RoomMemberHandler(metaclass=abc.ABCMeta): old_membership == Membership.INVITE and effective_membership_state == Membership.LEAVE ): - is_blocked = await self._is_server_notice_room(room_id) + is_blocked = await self.store.is_server_notice_room(room_id) if is_blocked: raise SynapseError( HTTPStatus.FORBIDDEN, @@ -1617,14 +1617,6 @@ class RoomMemberHandler(metaclass=abc.ABCMeta): return False - async def _is_server_notice_room(self, room_id: str) -> bool: - if self._server_notices_mxid is None: - return False - is_server_notices_room = await self.store.check_local_user_in_room( - user_id=self._server_notices_mxid, room_id=room_id - ) - return is_server_notices_room - class RoomMemberMasterHandler(RoomMemberHandler): def __init__(self, hs: "HomeServer"): |