diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-05-11 21:35:08 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-05-11 21:35:08 +0100 |
commit | 5227a94ea822c9a4a9e60cd9a28278311494f5bd (patch) | |
tree | b2a35f6af2780d1bf095189c7cbaaf0c84c3e15b | |
parent | 1bdf86cdff56a84540f7f695fcde3e0ef292bd18 (diff) | |
parent | bf578b83ea8c6b5500d08732decd74ccbcc7362d (diff) | |
download | prosody-5227a94ea822c9a4a9e60cd9a28278311494f5bd.tar.gz prosody-5227a94ea822c9a4a9e60cd9a28278311494f5bd.zip |
Merge with backout
-rw-r--r-- | plugins/adhoc/adhoc.lib.lua | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/plugins/adhoc/adhoc.lib.lua b/plugins/adhoc/adhoc.lib.lua index 57059b3f..0cb4efe1 100644 --- a/plugins/adhoc/adhoc.lib.lua +++ b/plugins/adhoc/adhoc.lib.lua @@ -25,7 +25,6 @@ function _M.new(name, node, handler, permission) end function _M.handle_cmd(command, origin, stanza) - local cmdtag, actions; local sessionid = stanza.tags[1].attr.sessionid or uuid.generate(); local dataIn = {}; dataIn.to = stanza.attr.to; @@ -59,7 +58,7 @@ function _M.handle_cmd(command, origin, stanza) elseif name == "error" then cmdtag:tag("note", {type="error"}):text(content.message):up(); elseif name =="actions" then - actions = st.stanza("actions"); + local actions = st.stanza("actions"); for _, action in ipairs(content) do if (action == "prev") or (action == "next") or (action == "complete") then actions:tag(action):up(); @@ -68,6 +67,7 @@ function _M.handle_cmd(command, origin, stanza) '" at node "'..command.node..'" provided an invalid action "'..action..'"'); end end + cmdtag:add_child(actions); elseif name == "form" then cmdtag:add_child((content.layout or content):form(content.values)); elseif name == "result" then @@ -76,13 +76,6 @@ function _M.handle_cmd(command, origin, stanza) cmdtag:add_child(content); end end - - if not actions then - actions = st.stanza("actions"); - actions:tag("complete"):up(); - end - cmdtag:add_child(actions); - stanza:add_child(cmdtag); origin.send(stanza); |