diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-03-17 07:14:39 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-17 07:14:39 -0400 |
commit | b449af0379db871945f32a572883d47b5c9018a3 (patch) | |
tree | e9b5b4ad421e63260d1de848ed0867fde0d8fff5 /synapse/handlers/room_member_worker.py | |
parent | Enable flake8-bugbear, but disable most checks. (#9499) (diff) | |
download | synapse-b449af0379db871945f32a572883d47b5c9018a3.tar.xz |
Add type hints to the room member handler. (#9631)
Diffstat (limited to 'synapse/handlers/room_member_worker.py')
-rw-r--r-- | synapse/handlers/room_member_worker.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/handlers/room_member_worker.py b/synapse/handlers/room_member_worker.py index 108730a7a1..d75506c75e 100644 --- a/synapse/handlers/room_member_worker.py +++ b/synapse/handlers/room_member_worker.py @@ -14,7 +14,7 @@ # limitations under the License. import logging -from typing import List, Optional, Tuple +from typing import TYPE_CHECKING, List, Optional, Tuple from synapse.api.errors import SynapseError from synapse.handlers.room_member import RoomMemberHandler @@ -25,11 +25,14 @@ from synapse.replication.http.membership import ( ) from synapse.types import Requester, UserID +if TYPE_CHECKING: + from synapse.app.homeserver import HomeServer + logger = logging.getLogger(__name__) class RoomMemberWorkerHandler(RoomMemberHandler): - def __init__(self, hs): + def __init__(self, hs: "HomeServer"): super().__init__(hs) self._remote_join_client = ReplRemoteJoin.make_client(hs) @@ -83,3 +86,6 @@ class RoomMemberWorkerHandler(RoomMemberHandler): await self._notify_change_client( user_id=target.to_string(), room_id=room_id, change="left" ) + + async def forget(self, target: UserID, room_id: str) -> None: + raise RuntimeError("Cannot forget rooms on workers.") |