aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/adhoc/adhoc.lib.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/adhoc/adhoc.lib.lua')
-rw-r--r--plugins/adhoc/adhoc.lib.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/adhoc/adhoc.lib.lua b/plugins/adhoc/adhoc.lib.lua
index 0b910299..0c61a636 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)