Software /
code /
prosody
Changeset
4859:54eb17126bd3
Merge with backout
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 11 May 2012 21:35:08 +0100 |
parents | 4857:0991a127ac43 (current diff) 4858:33458e1d84c8 (diff) |
children | 4860:b66e73793cb7 |
files | |
diffstat | 1 files changed, 2 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/adhoc/adhoc.lib.lua Fri May 11 21:27:42 2012 +0100 +++ b/plugins/adhoc/adhoc.lib.lua Fri May 11 21:35:08 2012 +0100 @@ -25,7 +25,6 @@ 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 @@ 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 @@ '" 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 @@ 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);