diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-10-26 17:10:30 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-10-26 17:10:30 +0100 |
commit | 193cadc988801d9035124d1fd3ca23607b9b1f25 (patch) | |
tree | 40416fa709bd6f13ef1b2c272d978cec822de80b /synapse/rest | |
parent | fix broken test (diff) | |
download | synapse-193cadc988801d9035124d1fd3ca23607b9b1f25.tar.xz |
Address review comments
Improve comments, get old room state from the context we already have
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/client/v2_alpha/room_upgrade_rest_servlet.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/synapse/rest/client/v2_alpha/room_upgrade_rest_servlet.py b/synapse/rest/client/v2_alpha/room_upgrade_rest_servlet.py index 1b195f90c4..e6356101fd 100644 --- a/synapse/rest/client/v2_alpha/room_upgrade_rest_servlet.py +++ b/synapse/rest/client/v2_alpha/room_upgrade_rest_servlet.py @@ -31,6 +31,22 @@ logger = logging.getLogger(__name__) class RoomUpgradeRestServlet(RestServlet): + """Handler for room uprade requests. + + Handles requests of the form: + + POST /_matrix/client/r0/rooms/$roomid/upgrade HTTP/1.1 + Content-Type: application/json + + { + "new_version": "2", + } + + Creates a new room and shuts down the old one. Returns the ID of the new room. + + Args: + hs (synapse.server.HomeServer): + """ PATTERNS = client_v2_patterns( # /rooms/$roomid/upgrade "/rooms/(?P<room_id>[^/]*)/upgrade$", @@ -38,11 +54,6 @@ class RoomUpgradeRestServlet(RestServlet): ) def __init__(self, hs): - """ - - Args: - hs (synapse.server.HomeServer): - """ super(RoomUpgradeRestServlet, self).__init__() self._hs = hs self._room_creation_handler = hs.get_room_creation_handler() |