# HG changeset patch # User Kim Alvefur # Date 1374695376 -7200 # Node ID ebc0749181735c205fdd09d9bba1419378dd038b # Parent b5ba004beb0a6b4408ff4a3ff4b79e43a4430301 adhoc.lib: Don't build error reply from reply stanza diff -r b5ba004beb0a -r ebc074918173 plugins/adhoc/adhoc.lib.lua --- a/plugins/adhoc/adhoc.lib.lua Wed Jul 24 15:28:36 2013 +0200 +++ b/plugins/adhoc/adhoc.lib.lua Wed Jul 24 21:49:36 2013 +0200 @@ -34,7 +34,6 @@ 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 @@ 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 @@ 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