]> granicus.if.org Git - ejabberd/commitdiff
Recognize "- who:" not only "who:" syntax in api_permissions
authorPaweł Chmielowski <pchmielowski@process-one.net>
Thu, 8 Dec 2016 11:01:24 +0000 (12:01 +0100)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Thu, 8 Dec 2016 11:01:24 +0000 (12:01 +0100)
src/ejabberd_access_permissions.erl

index 60ad68a291380c968802a4f9af263ee78e8fa703..1939bcfa081247421c052bd0ef88a463aa154330 100644 (file)
@@ -331,7 +331,8 @@ command_matches_patterns(C, [_ | Tail]) ->
 parse_api_permissions(Data) when is_list(Data) ->
     throw({replace_with, [parse_api_permission(Name, Args) || {Name, Args} <- Data]}).
 
-parse_api_permission(Name, Args) ->
+parse_api_permission(Name, Args0) ->
+    Args = lists:flatten(Args0),
     {From, Who, What} = case key_split(Args, [{from, []}, {who, none}, {what, []}]) of
                            {error, Msg} ->
                                report_error(<<"~s inside api_permission '~s' section">>, [Msg, Name]);