summary refs log tree commit diff
path: root/synapse/appservice
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2016-08-18 16:09:50 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2016-08-18 16:09:50 +0100
commit06964c4a0adabf7d983cbd0d2c6d83eba6fcaf79 (patch)
treecd3eb6fb5c8c5558aba941ddc55a0cfff1dd0703 /synapse/appservice
parentRemove TODO note about request fields being strings - they're always strings (diff)
downloadsynapse-06964c4a0adabf7d983cbd0d2c6d83eba6fcaf79.tar.xz
Copypasta the 3PU support code to also do 3PL
Diffstat (limited to 'synapse/appservice')
-rw-r--r--synapse/appservice/api.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/appservice/api.py b/synapse/appservice/api.py
index e05570cc8b..4ccb5c43c1 100644
--- a/synapse/appservice/api.py
+++ b/synapse/appservice/api.py
@@ -83,6 +83,17 @@ class ApplicationServiceApi(SimpleHttpClient):
             defer.returnValue([])
 
     @defer.inlineCallbacks
+    def query_3pl(self, service, protocol, fields):
+        uri = service.url + ("/3pl/%s" % urllib.quote(protocol))
+        response = None
+        try:
+            response = yield self.get_json(uri, fields)
+            defer.returnValue(response)
+        except Exception as ex:
+            logger.warning("query_3pl to %s threw exception %s", uri, ex)
+            defer.returnValue([])
+
+    @defer.inlineCallbacks
     def push_bulk(self, service, events, txn_id=None):
         events = self._serialize(events)