mod_adhoc: Add support for specifying a default action
authorFlorian Zeitz <florob@babelmonkeys.de>
Thu, 2 Aug 2012 19:28:14 +0000 (21:28 +0200)
committerFlorian Zeitz <florob@babelmonkeys.de>
Thu, 2 Aug 2012 19:28:14 +0000 (21:28 +0200)
plugins/adhoc/adhoc.lib.lua

index acdae6b9705604b83745901320a04f143cb8cac5..ecddcd1d173ec3e6e9196227ee8b3be90a39c825 100644 (file)
@@ -59,8 +59,8 @@ function _M.handle_cmd(command, origin, stanza)
                        cmdtag:tag("note", {type="warn"}):text(content):up();
                elseif name == "error" then
                        cmdtag:tag("note", {type="error"}):text(content.message):up();
-               elseif name =="actions" then
-                       local actions = st.stanza("actions");
+               elseif name == "actions" then
+                       local actions = st.stanza("actions", { execute = content.default });
                        for _, action in ipairs(content) do
                                if (action == "prev") or (action == "next") or (action == "complete") then
                                        actions:tag(action):up();