diff options
author | Maxime “pep” Buquet <pep@bouah.net> | 2018-07-01 01:36:26 +0100 |
---|---|---|
committer | Maxime “pep” Buquet <pep@bouah.net> | 2018-07-01 01:36:26 +0100 |
commit | caae713dd63a045e28260df962e97e98fb1c0a3a (patch) | |
tree | c5d10470dbb97e479e1c027edd3d211f5582dd08 /slixmpp/plugins/xep_0363/http_upload.py | |
parent | df0198abfee83b2a070a7cc2f1a543837189a4c5 (diff) | |
download | slixmpp-caae713dd63a045e28260df962e97e98fb1c0a3a.tar.gz slixmpp-caae713dd63a045e28260df962e97e98fb1c0a3a.tar.bz2 slixmpp-caae713dd63a045e28260df962e97e98fb1c0a3a.tar.xz slixmpp-caae713dd63a045e28260df962e97e98fb1c0a3a.zip |
xep_0030: rename find_identities; return all domain infos and let caller filter itself
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
Diffstat (limited to 'slixmpp/plugins/xep_0363/http_upload.py')
-rw-r--r-- | slixmpp/plugins/xep_0363/http_upload.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/slixmpp/plugins/xep_0363/http_upload.py b/slixmpp/plugins/xep_0363/http_upload.py index 3c0f2b3e..65894975 100644 --- a/slixmpp/plugins/xep_0363/http_upload.py +++ b/slixmpp/plugins/xep_0363/http_upload.py @@ -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): |