From 1a40699bcc3f3db663d2f71b06ec40d5212cd2ec Mon Sep 17 00:00:00 2001 From: nicoco Date: Sat, 25 Feb 2023 10:27:56 +0100 Subject: [PATCH 1/2] xep_0030: do not send IQ without 'from' attr when component --- slixmpp/plugins/xep_0030/disco.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/slixmpp/plugins/xep_0030/disco.py b/slixmpp/plugins/xep_0030/disco.py index cd7d9d63..1f09dad1 100644 --- a/slixmpp/plugins/xep_0030/disco.py +++ b/slixmpp/plugins/xep_0030/disco.py @@ -457,6 +457,9 @@ class XEP_0030(BasePlugin): the XEP-0059 plugin, if the plugin is loaded. Otherwise the parameter is ignored. """ + if ifrom is None and self.xmpp.is_component: + ifrom = self.xmpp.boundjid.bare + if local or local is None and jid is None: items = await self.api['get_items'](jid, node, ifrom, kwargs) return self._wrap(kwargs.get('ifrom', None), jid, items) From 21e5cd443514b87c45e7d4dff52805a8792eaadf Mon Sep 17 00:00:00 2001 From: nicoco Date: Sat, 25 Feb 2023 10:29:21 +0100 Subject: [PATCH 2/2] xep_0030: get_items(): fix ifrom for local calls kwargs can never have 'ifrom' since it's in the method signature --- slixmpp/plugins/xep_0030/disco.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slixmpp/plugins/xep_0030/disco.py b/slixmpp/plugins/xep_0030/disco.py index 1f09dad1..710062d5 100644 --- a/slixmpp/plugins/xep_0030/disco.py +++ b/slixmpp/plugins/xep_0030/disco.py @@ -462,7 +462,7 @@ class XEP_0030(BasePlugin): if local or local is None and jid is None: items = await self.api['get_items'](jid, node, ifrom, kwargs) - return self._wrap(kwargs.get('ifrom', None), jid, items) + return self._wrap(ifrom, jid, items) iq = self.xmpp.Iq() # Check dfrom parameter for backwards compatibility