25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-26 16:26:24 +01:00

When an obsolete ODBC module is starting, switch to the normal one

This commit is contained in:
Badlop 2010-08-05 00:49:19 +02:00
parent 690857e0d4
commit d4316558de

View File

@ -63,6 +63,19 @@ start() ->
start_module(Host, Module, Opts) -> start_module(Host, Module, Opts) ->
MTokens = string:tokens(atom_to_list(Module), "_"),
case lists:split(length(MTokens) - 1, MTokens) of
{ModulePlainList, ["odbc"]} ->
Module2 = list_to_atom(string:join(ModulePlainList, "_")),
?WARNING_MSG("The module ~p is obsolete. Replace it with ~p and "
"add the option {backend, odbc}",
[Module, Module2]),
start_module2(Host, Module2, [{backend, odbc} | Opts]);
_ ->
start_module2(Host, Module, Opts)
end.
start_module2(Host, Module, Opts) ->
set_module_opts_mnesia(Host, Module, Opts), set_module_opts_mnesia(Host, Module, Opts),
ets:insert(ejabberd_modules, ets:insert(ejabberd_modules,
#ejabberd_module{module_host = {Module, Host}, #ejabberd_module{module_host = {Module, Host},