Skip to content

Commit

Permalink
Merge 695b216 into b49a615
Browse files Browse the repository at this point in the history
  • Loading branch information
oxpa committed Mar 29, 2016
2 parents b49a615 + 695b216 commit b484454
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/gen_mod.erl
Expand Up @@ -35,7 +35,7 @@
get_module_opt/4, get_module_opt/5, get_module_opt_host/3,
loaded_modules/1, loaded_modules_with_opts/1,
get_hosts/2, get_module_proc/2, is_loaded/2,
start_modules/1, default_db/1, v_db/1, opt_type/1]).
start_modules/1, stop_modules/1, default_db/1, v_db/1, opt_type/1]).

%%-export([behaviour_info/1]).

Expand Down Expand Up @@ -129,6 +129,23 @@ stop_module(Host, Module) ->
ok -> ok
end.

-spec stop_modules(binary()) -> any().

stop_modules(Host) ->
Modules = ejabberd_config:get_option(
{modules, Host},
fun(Mods) ->
lists:map(
fun({M, A}) when is_atom(M), is_list(A) ->
{M, A}
end, Mods)
end, []),
lists:foreach(
fun({Module, _Args}) ->
?MODULE:stop_module_keep_config(Host, Module)
end, Modules).


-spec stop_module_keep_config(binary(), atom()) -> error | ok.

stop_module_keep_config(Host, Module) ->
Expand Down

0 comments on commit b484454

Please sign in to comment.