25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

Accept commands: add_commands syntax (along commands: - add_commands)

This commit is contained in:
Paweł Chmielowski 2016-04-21 11:15:53 +02:00
parent 1aae8a9fda
commit 97e3a33077

View File

@ -703,10 +703,11 @@ get_access_commands(AccessCommands, _Version) ->
get_commands() -> get_commands() ->
get_commands(?DEFAULT_VERSION). get_commands(?DEFAULT_VERSION).
get_commands(Version) -> get_commands(Version) ->
Opts = ejabberd_config:get_option( Opts0 = ejabberd_config:get_option(
commands, commands,
fun(V) when is_list(V) -> V end, fun(V) when is_list(V) -> V end,
[]), []),
Opts = lists:map(fun(V) when is_tuple(V) -> [V]; (V) -> V end, Opts0),
CommandsList = list_commands_policy(Version), CommandsList = list_commands_policy(Version),
OpenCmds = [N || {N, _, _, open} <- CommandsList], OpenCmds = [N || {N, _, _, open} <- CommandsList],
RestrictedCmds = [N || {N, _, _, restricted} <- CommandsList], RestrictedCmds = [N || {N, _, _, restricted} <- CommandsList],