mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-20 16:15:59 +01:00
For mod_vcard_* modules, redirect options to mod_vcard
This commit is contained in:
parent
92913389a5
commit
e7575ab63f
@ -106,15 +106,23 @@ emit_funs(Fd, _Mod, Specs, Globals) ->
|
|||||||
emit_funs(Fd, Mod, Specs) ->
|
emit_funs(Fd, Mod, Specs) ->
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun({Opt, Type}) ->
|
fun({Opt, Type}) ->
|
||||||
|
Mod2 = strip_db_type(Mod),
|
||||||
log(Fd,
|
log(Fd,
|
||||||
"-spec ~s(gen_mod:opts() | global | binary()) -> ~s.~n"
|
"-spec ~s(gen_mod:opts() | global | binary()) -> ~s.~n"
|
||||||
"~s(Opts) when is_map(Opts) ->~n"
|
"~s(Opts) when is_map(Opts) ->~n"
|
||||||
" gen_mod:get_opt(~s, Opts);~n"
|
" gen_mod:get_opt(~s, Opts);~n"
|
||||||
"~s(Host) ->~n"
|
"~s(Host) ->~n"
|
||||||
" gen_mod:get_module_opt(Host, ~s, ~s).~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).
|
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) ->
|
append({globals, Form}, _File, State) ->
|
||||||
[Clause] = erl_syntax:function_clauses(Form),
|
[Clause] = erl_syntax:function_clauses(Form),
|
||||||
Body = lists:last(erl_syntax:clause_body(Clause)),
|
Body = lists:last(erl_syntax:clause_body(Clause)),
|
||||||
|
Loading…
Reference in New Issue
Block a user