Include ext_mod modules when checking accepted options (ejabberd-contrib#116)

This commit is contained in:
Badlop 2015-09-10 20:11:02 +02:00
parent 8fd9670da2
commit a50f00f9e8
2 changed files with 3 additions and 2 deletions

View File

@ -53,6 +53,7 @@ start(normal, _Args) ->
ejabberd_commands:init(),
ejabberd_admin:start(),
gen_mod:start(),
ext_mod:start(),
ejabberd_config:start(),
set_settings_from_config(),
acl:start(),
@ -67,7 +68,6 @@ start(normal, _Args) ->
%ejabberd_debug:eprof_start(),
%ejabberd_debug:fprof_start(),
maybe_add_nameservers(),
ext_mod:start(),
ejabberd_auth:start(),
start_modules(),
ejabberd_listener:start_listeners(),

View File

@ -740,6 +740,7 @@ get_option(Opt, F, Default) ->
get_modules_with_options() ->
{ok, Mods} = application:get_key(ejabberd, modules),
ExtMods = [Name || {Name, _Details} <- ext_mod:installed()],
lists:foldl(
fun(Mod, D) ->
case catch Mod:opt_type('') of
@ -751,7 +752,7 @@ get_modules_with_options() ->
{'EXIT', {undef, _}} ->
D
end
end, dict:new(), [?MODULE|Mods]).
end, dict:new(), [?MODULE|ExtMods++Mods]).
validate_opts(#state{opts = Opts} = State) ->
ModOpts = get_modules_with_options(),