Filter 3PU lookups by only ASes that declare knowledge of that protocol

This commit is contained in:
Paul "LeoNerd" Evans 2016-08-18 14:56:02 +01:00
parent d5bf7a4a99
commit 434bbf2cb5
3 changed files with 22 additions and 3 deletions

View file

@ -191,9 +191,11 @@ class ApplicationServicesHandler(object):
@defer.inlineCallbacks
def _get_services_for_3pn(self, protocol):
# TODO(paul): Filter by protocol
services = yield self.store.get_app_services()
defer.returnValue(services)
interested_list = [
s for s in services if s.is_interested_in_protocol(protocol)
]
defer.returnValue(interested_list)
@defer.inlineCallbacks
def _is_unknown_user(self, user_id):