]> granicus.if.org Git - ejabberd/commitdiff
mod_muc_log: Fix configuration parsing
authorHolger Weiss <holger@zedat.fu-berlin.de>
Mon, 8 Dec 2014 14:51:06 +0000 (15:51 +0100)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Mon, 8 Dec 2014 14:51:06 +0000 (15:51 +0100)
Fix mod_muc_log's parsing of the "file_permissions" option.

Resolves #373.

src/mod_muc_log.erl

index bdaafd1974ee9727ea0723815ea74cee7696bd59..fa99ed9235e0d5dfb6346301be3aa5bbd6504ed0 100644 (file)
@@ -146,7 +146,13 @@ init([Host, Opts]) ->
                                     (plaintext) -> plaintext
                                  end, html),
     FilePermissions = gen_mod:get_opt(file_permissions, Opts,
-                                 fun({A, B}) -> {A, B}
+                                 fun(SubOpts) ->
+                                         F = fun({mode, Mode}, {_M, G}) ->
+                                                        {Mode, G};
+                                                ({group, Group}, {M, _G}) ->
+                                                        {M, Group}
+                                             end,
+                                         lists:foldl(F, {644, 33}, SubOpts)
                                  end, {644, 33}),
     CSSFile = gen_mod:get_opt(cssfile, Opts,
                               fun iolist_to_binary/1,