diff options
author | Badlop <badlop@process-one.net> | 2010-08-05 00:49:19 +0200 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2010-08-05 00:49:58 +0200 |
commit | d4316558de1dd00fdfd0075c3931ca2f4b3ba5d2 (patch) | |
tree | 628f1c0d13c5f82ace04d48887aa792925658e3d | |
parent | enforce disco features results (thanks to Karim)(EJAB-1033, EJAB-1228, EJAB-1... (diff) |
When an obsolete ODBC module is starting, switch to the normal one
-rw-r--r-- | src/gen_mod.erl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gen_mod.erl b/src/gen_mod.erl index 6e7a8fed0..d13b348d0 100644 --- a/src/gen_mod.erl +++ b/src/gen_mod.erl @@ -63,6 +63,19 @@ start() -> 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), ets:insert(ejabberd_modules, #ejabberd_module{module_host = {Module, Host}, |