aboutsummaryrefslogtreecommitdiff
path: root/src/ejabberd_commands.erl
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2017-02-06 21:40:37 +0100
committerPaweł Chmielowski <pchmielowski@process-one.net>2017-02-06 21:40:37 +0100
commitca0dd099448ecc72932f89e8c4159f8a65b45ebd (patch)
treec65da4fe96873be1778417e4bc56707012ee42ee /src/ejabberd_commands.erl
parentDon't shadow binding in match (diff)
Accept "add_commands: admin" in commands section not only "add_commands: - admin"
This fixes issue reported in #1518, and restores compatibility with what older version were accepting and what is documented.
Diffstat (limited to '')
-rw-r--r--src/ejabberd_commands.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ejabberd_commands.erl b/src/ejabberd_commands.erl
index 4ba38a559..9491288f9 100644
--- a/src/ejabberd_commands.erl
+++ b/src/ejabberd_commands.erl
@@ -818,6 +818,8 @@ get_exposed_commands(Version) ->
Cmds.
%% This is used to allow mixing command policy (like open, user, admin, restricted), with command entry
+expand_commands(L, OpenCmds, UserCmds, AdminCmds, RestrictedCmds) when is_atom(L) ->
+ expand_commands([L], OpenCmds, UserCmds, AdminCmds, RestrictedCmds);
expand_commands(L, OpenCmds, UserCmds, AdminCmds, RestrictedCmds) when is_list(L) ->
lists:foldl(fun(open, Acc) -> OpenCmds ++ Acc;
(user, Acc) -> UserCmds ++ Acc;