diff options
author | Erik Johnston <erik@matrix.org> | 2019-12-05 16:46:37 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-12-05 16:56:23 +0000 |
commit | 9c41ba4c5fe6e554bc885a1bef8ed51d14ec0f3e (patch) | |
tree | 7cf412d3be90fb978f46f8cda68ef210d3d6f7de /synapse/rest/client/v2_alpha/sendtodevice.py | |
parent | Merge pull request #6482 from matrix-org/erikj/port_rest_v1 (diff) | |
download | synapse-9c41ba4c5fe6e554bc885a1bef8ed51d14ec0f3e.tar.xz |
Port rest.client.v2
Diffstat (limited to 'synapse/rest/client/v2_alpha/sendtodevice.py')
-rw-r--r-- | synapse/rest/client/v2_alpha/sendtodevice.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/synapse/rest/client/v2_alpha/sendtodevice.py b/synapse/rest/client/v2_alpha/sendtodevice.py index d90e52ed1a..501b52fb6c 100644 --- a/synapse/rest/client/v2_alpha/sendtodevice.py +++ b/synapse/rest/client/v2_alpha/sendtodevice.py @@ -15,8 +15,6 @@ import logging -from twisted.internet import defer - from synapse.http import servlet from synapse.http.servlet import parse_json_object_from_request from synapse.logging.opentracing import set_tag, trace @@ -51,15 +49,14 @@ class SendToDeviceRestServlet(servlet.RestServlet): request, self._put, request, message_type, txn_id ) - @defer.inlineCallbacks - def _put(self, request, message_type, txn_id): - requester = yield self.auth.get_user_by_req(request, allow_guest=True) + async def _put(self, request, message_type, txn_id): + requester = await self.auth.get_user_by_req(request, allow_guest=True) content = parse_json_object_from_request(request) sender_user_id = requester.user.to_string() - yield self.device_message_handler.send_device_message( + await self.device_message_handler.send_device_message( sender_user_id, message_type, content["messages"] ) |