summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2022-09-09 16:07:46 +0000
committermathieui <mathieui@mathieui.net>2022-09-09 16:07:46 +0000
commitafdfa1ee5715d9f1e96aadf8cbcd71f0082d8ab7 (patch)
treebe44180f5108b384aee1f02c4fc23e5ea8a35853
parentcba5dc7ddc88c110e516d2d40679367f56865196 (diff)
parent14786abd348e56a2cfcbeddfe21bf6f6515c0db6 (diff)
downloadslixmpp-afdfa1ee5715d9f1e96aadf8cbcd71f0082d8ab7.tar.gz
slixmpp-afdfa1ee5715d9f1e96aadf8cbcd71f0082d8ab7.tar.bz2
slixmpp-afdfa1ee5715d9f1e96aadf8cbcd71f0082d8ab7.tar.xz
slixmpp-afdfa1ee5715d9f1e96aadf8cbcd71f0082d8ab7.zip
Merge branch 'xep0363-as-component' into 'master'
XEP-0363: Fix upload service auto discovery for components See merge request poezio/slixmpp!207
-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)