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

For mod_vcard_* modules, redirect options to mod_vcard

This commit is contained in:
Badlop 2020-08-21 17:33:44 +02:00
parent 92913389a5
commit e7575ab63f

View File

@ -106,15 +106,23 @@ emit_funs(Fd, _Mod, Specs, Globals) ->
emit_funs(Fd, Mod, Specs) ->
lists:foreach(
fun({Opt, Type}) ->
Mod2 = strip_db_type(Mod),
log(Fd,
"-spec ~s(gen_mod:opts() | global | binary()) -> ~s.~n"
"~s(Opts) when is_map(Opts) ->~n"
" gen_mod:get_opt(~s, Opts);~n"
"~s(Host) ->~n"
" gen_mod:get_module_opt(Host, ~s, ~s).~n",
[Opt, t_to_string(Type), Opt, Opt, Opt, Mod, Opt])
[Opt, t_to_string(Type), Opt, Opt, Opt, Mod2, Opt])
end, Specs).
strip_db_type(mod_vcard_ldap) ->
mod_vcard;
strip_db_type(mod_vcard_mnesia) ->
mod_vcard;
strip_db_type(Mod) ->
Mod.
append({globals, Form}, _File, State) ->
[Clause] = erl_syntax:function_clauses(Form),
Body = lists:last(erl_syntax:clause_body(Clause)),