diff options
author | Kim Alvefur <zash@zash.se> | 2015-09-21 23:06:22 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-09-21 23:06:22 +0200 |
commit | 7cfa1513cc23bb7b305f2607581c7fece4c2bf95 (patch) | |
tree | 51c885a7cf41b96add1632b35c686a93ee62dfec /plugins/adhoc | |
parent | f2bb3380518228e578e43c51aae4fe41601c25f6 (diff) | |
download | prosody-7cfa1513cc23bb7b305f2607581c7fece4c2bf95.tar.gz prosody-7cfa1513cc23bb7b305f2607581c7fece4c2bf95.zip |
plugins: Explicitly return to halt event propagation (session.send sometimes does not return true)
Diffstat (limited to 'plugins/adhoc')
-rw-r--r-- | plugins/adhoc/mod_adhoc.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/adhoc/mod_adhoc.lua b/plugins/adhoc/mod_adhoc.lua index f3e7f520..1c956021 100644 --- a/plugins/adhoc/mod_adhoc.lua +++ b/plugins/adhoc/mod_adhoc.lua @@ -34,7 +34,8 @@ module:hook("host-disco-info-node", function (event) reply:tag("feature", { var = "jabber:x:data" }):up(); event.exists = true; else - return origin.send(st.error_reply(stanza, "auth", "forbidden", "This item is not available to you")); + origin.send(st.error_reply(stanza, "auth", "forbidden", "This item is not available to you")); + return true; end elseif node == xmlns_cmd then reply:tag("identity", { name = "Ad-Hoc Commands", @@ -87,7 +88,8 @@ module:hook("iq/host/"..xmlns_cmd..":command", function (event) return true end -- User has permission now execute the command - return adhoc_handle_cmd(commands[node], origin, stanza); + adhoc_handle_cmd(commands[node], origin, stanza); + return true; end end end, 500); |