diff options
Diffstat (limited to 'plugins/adhoc/adhoc.lib.lua')
-rw-r--r-- | plugins/adhoc/adhoc.lib.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/adhoc/adhoc.lib.lua b/plugins/adhoc/adhoc.lib.lua index 0b910299..4cf6911d 100644 --- a/plugins/adhoc/adhoc.lib.lua +++ b/plugins/adhoc/adhoc.lib.lua @@ -21,7 +21,13 @@ local function _cmdtag(desc, status, sessionid, action) end function _M.new(name, node, handler, permission) - return { name = name, node = node, handler = handler, cmdtag = _cmdtag, permission = (permission or "user") }; + if not permission then + error "adhoc.new() expects a permission argument, none given" + end + if permission == "user" then + error "the permission mode 'user' has been renamed 'any', please update your code" + end + return { name = name, node = node, handler = handler, cmdtag = _cmdtag, permission = permission }; end function _M.handle_cmd(command, origin, stanza) @@ -45,7 +51,7 @@ function _M.handle_cmd(command, origin, stanza) cmdreply = command:cmdtag("canceled", sessionid); elseif data.status == "error" then states[sessionid] = nil; - local reply = st.error_reply(stanza, data.error.type, data.error.condition, data.error.message); + local reply = st.error_reply(stanza, data.error); origin.send(reply); return true; else |