aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/adhoc/adhoc.lib.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-07-24 21:49:36 +0200
committerKim Alvefur <zash@zash.se>2013-07-24 21:49:36 +0200
commit63cf2999c50fe6e3e6cc19e83c88bc7bac5b3c40 (patch)
tree34a09e1ce37c86ad0a20e889361c5bf864ea56d9 /plugins/adhoc/adhoc.lib.lua
parent36c85822d16ac767abb7874f245f93718b0e50aa (diff)
downloadprosody-63cf2999c50fe6e3e6cc19e83c88bc7bac5b3c40.tar.gz
prosody-63cf2999c50fe6e3e6cc19e83c88bc7bac5b3c40.zip
adhoc.lib: Don't build error reply from reply stanza
Diffstat (limited to 'plugins/adhoc/adhoc.lib.lua')
-rw-r--r--plugins/adhoc/adhoc.lib.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/adhoc/adhoc.lib.lua b/plugins/adhoc/adhoc.lib.lua
index ecddcd1d..b544ddc8 100644
--- a/plugins/adhoc/adhoc.lib.lua
+++ b/plugins/adhoc/adhoc.lib.lua
@@ -34,7 +34,6 @@ function _M.handle_cmd(command, origin, stanza)
local data, state = command:handler(dataIn, states[sessionid]);
states[sessionid] = state;
- local stanza = st.reply(stanza);
local cmdtag;
if data.status == "completed" then
states[sessionid] = nil;
@@ -44,8 +43,8 @@ function _M.handle_cmd(command, origin, stanza)
cmdtag = command:cmdtag("canceled", sessionid);
elseif data.status == "error" then
states[sessionid] = nil;
- stanza = st.error_reply(stanza, data.error.type, data.error.condition, data.error.message);
- origin.send(stanza);
+ local reply = st.error_reply(stanza, data.error.type, data.error.condition, data.error.message);
+ origin.send(reply);
return true;
else
cmdtag = command:cmdtag("executing", sessionid);
@@ -78,8 +77,9 @@ function _M.handle_cmd(command, origin, stanza)
cmdtag:add_child(content);
end
end
- stanza:add_child(cmdtag);
- origin.send(stanza);
+ local reply = st.reply(stanza);
+ reply:add_child(cmdtag);
+ origin.send(reply);
return true;
end