mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:06:07 -04:00
Merge pull request #1026 from matrix-org/paul/thirdpartylookup
3rd party entity lookup
This commit is contained in:
commit
5674ea3e6c
7 changed files with 189 additions and 1 deletions
|
@ -159,6 +159,22 @@ class ApplicationServicesHandler(object):
|
|||
)
|
||||
defer.returnValue(result)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def query_3pe(self, kind, protocol, fields):
|
||||
services = yield self._get_services_for_3pn(protocol)
|
||||
|
||||
results = yield defer.DeferredList([
|
||||
self.appservice_api.query_3pe(service, kind, protocol, fields)
|
||||
for service in services
|
||||
], consumeErrors=True)
|
||||
|
||||
ret = []
|
||||
for (success, result) in results:
|
||||
if success:
|
||||
ret.extend(result)
|
||||
|
||||
defer.returnValue(ret)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def _get_services_for_event(self, event):
|
||||
"""Retrieve a list of application services interested in this event.
|
||||
|
@ -187,6 +203,14 @@ class ApplicationServicesHandler(object):
|
|||
]
|
||||
defer.returnValue(interested_list)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def _get_services_for_3pn(self, protocol):
|
||||
services = yield self.store.get_app_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):
|
||||
if not self.is_mine_id(user_id):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue