Merge branch 'xep0363-as-component' into 'master'

XEP-0363: Fix upload service auto discovery for components

See merge request poezio/slixmpp!207
This commit is contained in:
mathieui 2022-09-09 16:07:46 +00:00
commit afdfa1ee57

View file

@ -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)