mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:06:05 -04:00
Implement _simple_delete_many_txn, use it to delete devices
(But this doesn't implement the same for deleting access tokens or e2e keys. Also respond to code review.
This commit is contained in:
parent
c077c3277b
commit
bbeeb97f75
4 changed files with 101 additions and 11 deletions
|
@ -108,6 +108,23 @@ class DeviceStore(SQLBaseStore):
|
|||
desc="delete_device",
|
||||
)
|
||||
|
||||
def delete_devices(self, user_id, device_ids):
|
||||
"""Deletes several devices.
|
||||
|
||||
Args:
|
||||
user_id (str): The ID of the user which owns the devices
|
||||
device_ids (list): The IDs of the devices to delete
|
||||
Returns:
|
||||
defer.Deferred
|
||||
"""
|
||||
return self._simple_delete_many(
|
||||
table="devices",
|
||||
column="device_id",
|
||||
iterable=device_ids,
|
||||
keyvalues={"user_id": user_id},
|
||||
desc="delete_devices",
|
||||
)
|
||||
|
||||
def update_device(self, user_id, device_id, new_display_name=None):
|
||||
"""Update a device.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue