Software /
code /
prosody-modules
Diff
mod_delegation/mod_delegation.lua @ 3271:7504f765e767
mod_delegation: Simplify iq handling by hooking on iq-get/ instead of iq/.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 24 Aug 2018 21:36:58 +0200 |
parent | 2758:82109d8eca41 |
child | 3317:36a9170352b5 |
line wrap: on
line diff
--- a/mod_delegation/mod_delegation.lua Fri Aug 24 21:35:47 2018 +0200 +++ b/mod_delegation/mod_delegation.lua Fri Aug 24 21:36:58 2018 +0200 @@ -565,7 +565,6 @@ -- account-disco-items can't be cancelled (return value of hooks are not checked in mod_disco), so corountine needs -- to be used with util.async (to get the IQ result, merge items then return from the event) local origin, stanza = event.origin, event.stanza; - if stanza.attr.type ~= "get" then return; end local node = stanza.tags[1].attr.node; local username = jid_split(stanza.attr.to) or origin.username; if not stanza.attr.to or is_contact_subscribed(username, module.host, jid_bare(stanza.attr.from)) then @@ -578,7 +577,7 @@ end end end -module:hook("iq/bare/http://jabber.org/protocol/disco#items:query", disco_items_hook, 100) +module:hook("iq-get/bare/http://jabber.org/protocol/disco#items:query", disco_items_hook, 100) local function disco_items_raw_hook(event) -- this method is called when account-disco-items-* event are not called