Software / code / prosody
Comparison
plugins/adhoc/adhoc.lib.lua @ 5075:4d939d2b1574
mod_adhoc: Add support for specifying a default action
| author | Florian Zeitz <florob@babelmonkeys.de> |
|---|---|
| date | Thu, 02 Aug 2012 21:28:14 +0200 |
| parent | 4993:5243b74a4cbb |
| child | 5758:ebc074918173 |
comparison
equal
deleted
inserted
replaced
| 5074:a87afeea8b48 | 5075:4d939d2b1574 |
|---|---|
| 57 cmdtag:tag("note", {type="info"}):text(content):up(); | 57 cmdtag:tag("note", {type="info"}):text(content):up(); |
| 58 elseif name == "warn" then | 58 elseif name == "warn" then |
| 59 cmdtag:tag("note", {type="warn"}):text(content):up(); | 59 cmdtag:tag("note", {type="warn"}):text(content):up(); |
| 60 elseif name == "error" then | 60 elseif name == "error" then |
| 61 cmdtag:tag("note", {type="error"}):text(content.message):up(); | 61 cmdtag:tag("note", {type="error"}):text(content.message):up(); |
| 62 elseif name =="actions" then | 62 elseif name == "actions" then |
| 63 local actions = st.stanza("actions"); | 63 local actions = st.stanza("actions", { execute = content.default }); |
| 64 for _, action in ipairs(content) do | 64 for _, action in ipairs(content) do |
| 65 if (action == "prev") or (action == "next") or (action == "complete") then | 65 if (action == "prev") or (action == "next") or (action == "complete") then |
| 66 actions:tag(action):up(); | 66 actions:tag(action):up(); |
| 67 else | 67 else |
| 68 module:log("error", "Command %q at node %q provided an invalid action %q", | 68 module:log("error", "Command %q at node %q provided an invalid action %q", |