Software /
code /
prosody
Diff
plugins/adhoc/mod_adhoc.lua @ 6841:be87ab2d611c
plugins: Explicitly return to halt event propagation (session.send sometimes does not return true)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 21 Sep 2015 23:06:22 +0200 |
parent | 5762:785da1854eb9 |
child | 8460:77e59f8057bf |
line wrap: on
line diff
--- a/plugins/adhoc/mod_adhoc.lua Mon Sep 21 23:00:49 2015 +0200 +++ b/plugins/adhoc/mod_adhoc.lua Mon Sep 21 23:06:22 2015 +0200 @@ -34,7 +34,8 @@ 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 @@ 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);