diff options
author | Paweł Chmielowski <pchmielowski@process-one.net> | 2017-02-06 21:40:37 +0100 |
---|---|---|
committer | Paweł Chmielowski <pchmielowski@process-one.net> | 2017-02-06 21:40:37 +0100 |
commit | ca0dd099448ecc72932f89e8c4159f8a65b45ebd (patch) | |
tree | c65da4fe96873be1778417e4bc56707012ee42ee /src/ejabberd_commands.erl | |
parent | Don'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 'src/ejabberd_commands.erl')
-rw-r--r-- | src/ejabberd_commands.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ejabberd_commands.erl b/src/ejabberd_commands.erl index 4ba38a55..9491288f 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; |