summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Cedilnik <nicolas.cedilnik@inheart.fr>2022-06-18 06:09:36 +0200
committerNicolas Cedilnik <nicolas.cedilnik@inheart.fr>2022-06-18 06:09:36 +0200
commitafb5419b6820c2d4e256ff1ce2f31e4442dcfe2a (patch)
tree00072e7691e6e6fddf0f279df6a9a0358c80e471
parent5ceb48bbcd842962f8b8d206fddbce1dcfe7c069 (diff)
downloadslixmpp-afb5419b6820c2d4e256ff1ce2f31e4442dcfe2a.tar.gz
slixmpp-afb5419b6820c2d4e256ff1ce2f31e4442dcfe2a.tar.bz2
slixmpp-afb5419b6820c2d4e256ff1ce2f31e4442dcfe2a.tar.xz
slixmpp-afb5419b6820c2d4e256ff1ce2f31e4442dcfe2a.zip
XEP-0363: Fix upload service auto discovery for components
-rw-r--r--slixmpp/plugins/xep_0363/http_upload.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/slixmpp/plugins/xep_0363/http_upload.py b/slixmpp/plugins/xep_0363/http_upload.py
index 4a185fb9..c34be8ff 100644
--- a/slixmpp/plugins/xep_0363/http_upload.py
+++ b/slixmpp/plugins/xep_0363/http_upload.py
@@ -101,12 +101,17 @@ class XEP_0363(BasePlugin):
:param domain: Domain to disco to find a service.
"""
+ if domain is None and self.xmpp.is_component:
+ domain = self.xmpp.server_host
+
results = await self.xmpp['xep_0030'].get_info_from_domain(
domain=domain, **iqkwargs
)
candidates = []
for info in results:
+ if not info['disco_info']:
+ continue
for identity in info['disco_info']['identities']:
if identity[0] == 'store' and identity[1] == 'file':
candidates.append(info)