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

Add ability to hookup config transformer

This commit is contained in:
Paweł Chmielowski 2019-12-16 12:39:56 +01:00
parent 869826c818
commit 4b3a1ec614

View File

@ -27,11 +27,17 @@
%%% API %%% API
%%%=================================================================== %%%===================================================================
map_reduce(Y) -> map_reduce(Y) ->
F = fun(Y1) -> F =
Y2 = (validator())(Y1), fun(Y1) ->
Y3 = transform(Y2), Y2 = (validator())(Y1),
Y3 = transform(Y2),
case application:get_env(ejabberd, custom_config_transformer) of
{ok, TransMod} when is_atom(TransMod) ->
TransMod:transform(Y3);
_ ->
Y3 Y3
end, end
end,
econf:validate(F, Y). econf:validate(F, Y).
%%%=================================================================== %%%===================================================================