diff options
author | Richard van der Hoff <richard@matrix.org> | 2016-07-22 14:52:53 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2016-07-26 07:35:48 +0100 |
commit | 436bffd15fb8382a0d2dddd3c6f7a077ba751da2 (patch) | |
tree | d4c3857cb66386bf48f06293ae8ae28a558073ca /synapse/storage/devices.py | |
parent | Log when adding listeners (diff) | |
download | synapse-436bffd15fb8382a0d2dddd3c6f7a077ba751da2.tar.xz |
Implement deleting devices
Diffstat (limited to 'synapse/storage/devices.py')
-rw-r--r-- | synapse/storage/devices.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/synapse/storage/devices.py b/synapse/storage/devices.py index 1cc6e07f2b..4689980f80 100644 --- a/synapse/storage/devices.py +++ b/synapse/storage/devices.py @@ -76,6 +76,21 @@ class DeviceStore(SQLBaseStore): desc="get_device", ) + def delete_device(self, user_id, device_id): + """Delete a device. + + Args: + user_id (str): The ID of the user which owns the device + device_id (str): The ID of the device to retrieve + Returns: + defer.Deferred + """ + return self._simple_delete_one( + table="devices", + keyvalues={"user_id": user_id, "device_id": device_id}, + desc="delete_device", + ) + @defer.inlineCallbacks def get_devices_by_user(self, user_id): """Retrieve all of a user's registered devices. |