summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2016-08-18 00:39:09 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2016-08-18 00:39:09 +0100
commit3ec10dffd6105e8fc78cb60f08c4636abf9d76e6 (patch)
tree16a6e5336eafeb4e1a8bcce855baeb8eea69b948
parentThread 3PU lookup through as far as the AS API object; which currently noƶps it (diff)
downloadsynapse-3ec10dffd6105e8fc78cb60f08c4636abf9d76e6.tar.xz
Actually make 3PU lookup calls out to ASes
-rw-r--r--synapse/appservice/api.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/synapse/appservice/api.py b/synapse/appservice/api.py
index 6e5f7dc404..bfc1866591 100644
--- a/synapse/appservice/api.py
+++ b/synapse/appservice/api.py
@@ -71,8 +71,17 @@ class ApplicationServiceApi(SimpleHttpClient):
             logger.warning("query_alias to %s threw exception %s", uri, ex)
         defer.returnValue(False)
 
+    @defer.inlineCallbacks
     def query_3pu(self, service, protocol, fields):
-        return False
+        uri = service.url + ("/3pu/%s" % urllib.quote(protocol))
+        response = None
+        try:
+            response = yield self.get_json(uri, fields)
+            defer.returnValue(response)
+        except:
+            # TODO: would be noisy to log lookup failures, but we want to log
+            # other things. Hrm.
+            defer.returnValue([])
 
     @defer.inlineCallbacks
     def push_bulk(self, service, events, txn_id=None):