# HG changeset patch # User Emmanuel Gil Peyrot # Date 1535139418 -7200 # Node ID 7504f765e767bcb0c177007bf465a2f4bf9f5341 # Parent 7776c9dc5f37cb4e5dd99d265dbf2bee2d34b66d mod_delegation: Simplify iq handling by hooking on iq-get/ instead of iq/. diff -r 7776c9dc5f37 -r 7504f765e767 mod_delegation/mod_delegation.lua --- 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