xep_0030: rename find_identities; return all domain infos and let caller filter itself

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet
2018-07-01 01:36:26 +01:00
parent df0198abfe
commit caae713dd6
2 changed files with 9 additions and 10 deletions
+6 -3
View File
@@ -69,9 +69,12 @@ class XEP_0363(BasePlugin):
self.xmpp.event('http_upload_request', iq)
async def find_upload_service(self, timeout=None):
results = await self.xmpp['xep_0030'].find_identities('store', 'file')
if results:
return results[0]
results = await self.xmpp['xep_0030'].get_info_from_domain()
for info in results:
for identity in info['disco_info']['identities']:
if identity[0] == 'store' and identity[1] == 'file':
return info
def request_slot(self, jid, filename, size, content_type=None, ifrom=None,
timeout=None, callback=None, timeout_callback=None):