]> granicus.if.org Git - ejabberd/commitdiff
Accept commands: add_commands syntax (along commands: - add_commands)
authorPaweł Chmielowski <pchmielowski@process-one.net>
Thu, 21 Apr 2016 09:15:53 +0000 (11:15 +0200)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Thu, 21 Apr 2016 09:16:36 +0000 (11:16 +0200)
src/ejabberd_commands.erl

index dd14748d04df8600294f03f8db1acbd3c9862e2e..55ecba5d13d23e60478652d68a04c583ff390423 100644 (file)
@@ -703,10 +703,11 @@ get_access_commands(AccessCommands, _Version) ->
 get_commands() ->
     get_commands(?DEFAULT_VERSION).
 get_commands(Version) ->
-    Opts = ejabberd_config:get_option(
+    Opts0 = ejabberd_config:get_option(
              commands,
              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),
     OpenCmds = [N || {N, _, _, open} <- CommandsList],
     RestrictedCmds = [N || {N, _, _, restricted} <- CommandsList],