summary refs log tree commit diff
path: root/synapse/rest/client/v2_alpha/thirdparty.py
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2016-08-18 17:19:55 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2016-08-18 17:19:55 +0100
commitb515f844ee07c7d6aa1d7e56faa8b65d282e9341 (patch)
tree7d154e0c825e687fe19eed42998182aa07847d1b /synapse/rest/client/v2_alpha/thirdparty.py
parentMinor syntax neatenings (diff)
downloadsynapse-b515f844ee07c7d6aa1d7e56faa8b65d282e9341.tar.xz
Avoid so much copypasta between 3PU and 3PL query by unifying around a ThirdPartyEntityKind enumeration
Diffstat (limited to 'synapse/rest/client/v2_alpha/thirdparty.py')
-rw-r--r--synapse/rest/client/v2_alpha/thirdparty.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/synapse/rest/client/v2_alpha/thirdparty.py b/synapse/rest/client/v2_alpha/thirdparty.py
index d229e4b818..9abca3a8ad 100644
--- a/synapse/rest/client/v2_alpha/thirdparty.py
+++ b/synapse/rest/client/v2_alpha/thirdparty.py
@@ -19,6 +19,7 @@ import logging
 from twisted.internet import defer
 
 from synapse.http.servlet import RestServlet
+from synapse.types import ThirdPartyEntityKind
 from ._base import client_v2_patterns
 
 logger = logging.getLogger(__name__)
@@ -41,7 +42,9 @@ class ThirdPartyUserServlet(RestServlet):
         fields = request.args
         del fields["access_token"]
 
-        results = yield self.appservice_handler.query_3pu(protocol, fields)
+        results = yield self.appservice_handler.query_3pe(
+            ThirdPartyEntityKind.USER, protocol, fields
+        )
 
         defer.returnValue((200, results))
 
@@ -63,7 +66,9 @@ class ThirdPartyLocationServlet(RestServlet):
         fields = request.args
         del fields["access_token"]
 
-        results = yield self.appservice_handler.query_3pl(protocol, fields)
+        results = yield self.appservice_handler.query_3pe(
+            ThirdPartyEntityKind.LOCATION, protocol, fields
+        )
 
         defer.returnValue((200, results))