diff options
author | Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> | 2021-08-17 22:19:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-17 21:19:13 +0100 |
commit | 430241a1e9fd4fbb82d83958b61bbd66c9ba3505 (patch) | |
tree | 298aed2bae0d493595b8876a26d3d24c00e94f1f /synapse/rest/admin/rooms.py | |
parent | Port the PresenceRouter module interface to the new generic interface (#10524) (diff) | |
download | synapse-430241a1e9fd4fbb82d83958b61bbd66c9ba3505.tar.xz |
Remove deprecated Shutdown Room and Purge Room Admin API (#8830)
Diffstat (limited to 'synapse/rest/admin/rooms.py')
-rw-r--r-- | synapse/rest/admin/rooms.py | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/synapse/rest/admin/rooms.py b/synapse/rest/admin/rooms.py index 975c28b225..ad83d4b54c 100644 --- a/synapse/rest/admin/rooms.py +++ b/synapse/rest/admin/rooms.py @@ -46,41 +46,6 @@ if TYPE_CHECKING: logger = logging.getLogger(__name__) -class ShutdownRoomRestServlet(RestServlet): - """Shuts down a room by removing all local users from the room and blocking - all future invites and joins to the room. Any local aliases will be repointed - to a new room created by `new_room_user_id` and kicked users will be auto - joined to the new room. - """ - - PATTERNS = admin_patterns("/shutdown_room/(?P<room_id>[^/]+)") - - def __init__(self, hs: "HomeServer"): - self.hs = hs - self.auth = hs.get_auth() - self.room_shutdown_handler = hs.get_room_shutdown_handler() - - async def on_POST( - self, request: SynapseRequest, room_id: str - ) -> Tuple[int, JsonDict]: - requester = await self.auth.get_user_by_req(request) - await assert_user_is_admin(self.auth, requester.user) - - content = parse_json_object_from_request(request) - assert_params_in_dict(content, ["new_room_user_id"]) - - ret = await self.room_shutdown_handler.shutdown_room( - room_id=room_id, - new_room_user_id=content["new_room_user_id"], - new_room_name=content.get("room_name"), - message=content.get("message"), - requester_user_id=requester.user.to_string(), - block=True, - ) - - return (200, ret) - - class DeleteRoomRestServlet(RestServlet): """Delete a room from server. |