summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-03-10 22:07:00 +0100
committermathieui <mathieui@mathieui.net>2021-03-10 22:07:00 +0100
commit7f90fb594a9549bb7b7bcfbe4a1121417ad3e4e3 (patch)
tree9ea2401c5639940e0e7e63ee4d647ae9ceaf76ea
parent7c86c43fc74dd4786ff741386484b58d1c396e8b (diff)
downloadslixmpp-7f90fb594a9549bb7b7bcfbe4a1121417ad3e4e3.tar.gz
slixmpp-7f90fb594a9549bb7b7bcfbe4a1121417ad3e4e3.tar.bz2
slixmpp-7f90fb594a9549bb7b7bcfbe4a1121417ad3e4e3.tar.xz
slixmpp-7f90fb594a9549bb7b7bcfbe4a1121417ad3e4e3.zip
XEP-0030: Fix usage of ifrom in get_info
-rw-r--r--slixmpp/plugins/xep_0030/disco.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/slixmpp/plugins/xep_0030/disco.py b/slixmpp/plugins/xep_0030/disco.py
index 08dedbce..0fa09927 100644
--- a/slixmpp/plugins/xep_0030/disco.py
+++ b/slixmpp/plugins/xep_0030/disco.py
@@ -385,30 +385,30 @@ class XEP_0030(BasePlugin):
elif jid in (None, ''):
local = True
+ ifrom = kwargs.pop('ifrom', None)
if local:
log.debug("Looking up local disco#info data "
"for %s, node %s.", jid, node)
info = await self.api['get_info'](
- jid, node, kwargs.get('ifrom', None),
+ jid, node, ifrom,
kwargs
)
info = self._fix_default_info(info)
- return self._wrap(kwargs.get('ifrom', None), jid, info)
+ return self._wrap(ifrom, jid, info)
if cached:
log.debug("Looking up cached disco#info data "
"for %s, node %s.", jid, node)
info = await self.api['get_cached_info'](
- jid, node,
- kwargs.get('ifrom', None),
+ jid, node, ifrom,
kwargs
)
if info is not None:
- return self._wrap(kwargs.get('ifrom', None), jid, info)
+ return self._wrap(ifrom, jid, info)
iq = self.xmpp.Iq()
# Check dfrom parameter for backwards compatibility
- iq['from'] = kwargs.get('ifrom', kwargs.get('dfrom', ''))
+ iq['from'] = ifrom or kwargs.get('dfrom', '')
iq['to'] = jid
iq['type'] = 'get'
iq['disco_info']['node'] = node if node else ''