summary refs log tree commit diff
path: root/synapse/handlers/appservice.py
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2016-09-09 13:25:02 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2016-09-09 13:25:02 +0100
commit25eb769b26d6a13afcc9173e0eacf932e5cc1449 (patch)
tree61c7091efc4fc24322b4ba7a624e6224dffd6d31 /synapse/handlers/appservice.py
parentAllow lookup of a single 3PE protocol query metadata (diff)
downloadsynapse-25eb769b26d6a13afcc9173e0eacf932e5cc1449.tar.xz
Efficiency fix for lookups of a single protocol
Diffstat (limited to 'synapse/handlers/appservice.py')
-rw-r--r--synapse/handlers/appservice.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/handlers/appservice.py b/synapse/handlers/appservice.py
index e68628bdfd..a0375f7e3b 100644
--- a/synapse/handlers/appservice.py
+++ b/synapse/handlers/appservice.py
@@ -176,13 +176,16 @@ class ApplicationServicesHandler(object):
         defer.returnValue(ret)
 
     @defer.inlineCallbacks
-    def get_3pe_protocols(self):
+    def get_3pe_protocols(self, only_protocol=None):
         services = yield self.store.get_app_services()
         protocols = {}
 
         # Collect up all the individual protocol responses out of the ASes
         for s in services:
             for p in s.protocols:
+                if only_protocol is not None and p != only_protocol:
+                    continue
+
                 info = yield self.appservice_api.get_3pe_protocol(s, p)
 
                 # Ignore any result that doesn't contain an "instances" list