From ca0dd099448ecc72932f89e8c4159f8a65b45ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Mon, 6 Feb 2017 21:40:37 +0100 Subject: [PATCH] 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. --- src/ejabberd_commands.erl | 2 ++ 1 file changed, 2 insertions(+) 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;