mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:46:06 -04:00
Implement updating devices
You can update the displayname of devices now.
This commit is contained in:
parent
436bffd15f
commit
012b4c1913
5 changed files with 120 additions and 9 deletions
|
@ -141,6 +141,30 @@ class DeviceHandler(BaseHandler):
|
|||
yield self.store.user_delete_access_tokens(user_id,
|
||||
device_id=device_id)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def update_device(self, user_id, device_id, content):
|
||||
""" Update the given device
|
||||
|
||||
Args:
|
||||
user_id (str):
|
||||
device_id (str):
|
||||
content (dict): body of update request
|
||||
|
||||
Returns:
|
||||
defer.Deferred:
|
||||
"""
|
||||
|
||||
try:
|
||||
yield self.store.update_device(
|
||||
user_id,
|
||||
device_id,
|
||||
new_display_name=content.get("display_name")
|
||||
)
|
||||
except errors.StoreError, e:
|
||||
if e.code == 404:
|
||||
raise errors.NotFoundError()
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
def _update_device_from_client_ips(device, client_ips):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue