summary refs log tree commit diff
path: root/synapse/rest/client/v2_alpha
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-04-17 17:20:18 +0100
committerDavid Baker <dave@matrix.org>2015-04-17 17:20:18 +0100
commit117f35ac4ac4f8d344ae1efbc629a3f8bc25f459 (patch)
tree3813c1155b09bb49b86976eae884b2e8eae2a3f2 /synapse/rest/client/v2_alpha
parentpep8 (diff)
downloadsynapse-117f35ac4ac4f8d344ae1efbc629a3f8bc25f459.tar.xz
Add endpoint to get threepids from server
Diffstat (limited to 'synapse/rest/client/v2_alpha')
-rw-r--r--synapse/rest/client/v2_alpha/account.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/rest/client/v2_alpha/account.py b/synapse/rest/client/v2_alpha/account.py

index 6045b016ef..5ac3ac0f71 100644 --- a/synapse/rest/client/v2_alpha/account.py +++ b/synapse/rest/client/v2_alpha/account.py
@@ -89,6 +89,18 @@ class ThreepidRestServlet(RestServlet): self.auth = hs.get_auth() @defer.inlineCallbacks + def on_GET(self, request): + yield run_on_reactor() + + auth_user, _ = yield self.auth.get_user_by_req(request) + + threepids = yield self.hs.get_datastore().user_get_threepids( + auth_user.to_string() + ) + + defer.returnValue((200, {'threepids': threepids})) + + @defer.inlineCallbacks def on_POST(self, request): yield run_on_reactor()