diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2022-06-07 07:43:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-07 07:43:35 -0400 |
commit | 9dc3293e0b3a5cbf6fcc4a0cef7386b531190882 (patch) | |
tree | 97a293afac5f1b5e7649de833f2b6be5112b6e00 /synapse/rest/client | |
parent | Prevent breaking old sqlite's when media retention is enabled (#12977) (diff) | |
download | synapse-9dc3293e0b3a5cbf6fcc4a0cef7386b531190882.tar.xz |
Consolidate the logic of delete_device/delete_devices. (#12970)
By always using delete_devices and sometimes passing a list with a single device ID. Previously these methods had gotten out of sync with each other and it seems there's little benefit to the single-device variant.
Diffstat (limited to 'synapse/rest/client')
-rw-r--r-- | synapse/rest/client/devices.py | 4 | ||||
-rw-r--r-- | synapse/rest/client/logout.py | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/synapse/rest/client/devices.py b/synapse/rest/client/devices.py index ad6fd6492b..6fab102437 100644 --- a/synapse/rest/client/devices.py +++ b/synapse/rest/client/devices.py @@ -147,7 +147,9 @@ class DeviceRestServlet(RestServlet): can_skip_ui_auth=True, ) - await self.device_handler.delete_device(requester.user.to_string(), device_id) + await self.device_handler.delete_devices( + requester.user.to_string(), [device_id] + ) return 200, {} async def on_PUT( diff --git a/synapse/rest/client/logout.py b/synapse/rest/client/logout.py index 193a6951b9..23dfa4518f 100644 --- a/synapse/rest/client/logout.py +++ b/synapse/rest/client/logout.py @@ -45,8 +45,8 @@ class LogoutRestServlet(RestServlet): access_token = self.auth.get_access_token_from_request(request) await self._auth_handler.delete_access_token(access_token) else: - await self._device_handler.delete_device( - requester.user.to_string(), requester.device_id + await self._device_handler.delete_devices( + requester.user.to_string(), [requester.device_id] ) return 200, {} |