mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-23 19:19:53 +00:00
Allow disco info/items handlers to return full Iq stanzas.
Only allowing handlers to return a DiscoInfo/DiscoItem stanza works for the majority of cases, but does not allow for the addition of an RSM stanza, or other extensions. An Iq stanza returned by a handler must already be configured as a reply.
This commit is contained in:
parent
85e9042db6
commit
fc8a13df5a
1 changed files with 15 additions and 9 deletions
|
@ -551,6 +551,9 @@ class xep_0030(base_plugin):
|
||||||
jid,
|
jid,
|
||||||
iq['disco_info']['node'],
|
iq['disco_info']['node'],
|
||||||
iq)
|
iq)
|
||||||
|
if isinstance(info, Iq):
|
||||||
|
info.send()
|
||||||
|
else:
|
||||||
iq.reply()
|
iq.reply()
|
||||||
if info:
|
if info:
|
||||||
info = self._fix_default_info(info)
|
info = self._fix_default_info(info)
|
||||||
|
@ -581,6 +584,9 @@ class xep_0030(base_plugin):
|
||||||
jid,
|
jid,
|
||||||
iq['disco_items']['node'],
|
iq['disco_items']['node'],
|
||||||
iq)
|
iq)
|
||||||
|
if isinstance(items, Iq):
|
||||||
|
items.send()
|
||||||
|
else:
|
||||||
iq.reply()
|
iq.reply()
|
||||||
if items:
|
if items:
|
||||||
iq.set_payload(items.xml)
|
iq.set_payload(items.xml)
|
||||||
|
|
Loading…
Reference in a new issue