diff options
author | Badlop <badlop@process-one.net> | 2019-04-03 12:50:28 +0200 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2019-04-03 13:10:11 +0200 |
commit | 4e591a73c560db9cf803e6ad0082212e66dd0c42 (patch) | |
tree | 0678f02ed585a83eeb0b08d2e3fabfb05f1e9046 | |
parent | Return proper error message for duplicate or missing args in http_api call (diff) |
Add ext_mod paths before checking config (processone/ejabberd-contrib#263)
-rw-r--r-- | src/ejabberd_config.erl | 1 | ||||
-rw-r--r-- | src/ext_mod.erl | 9 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/ejabberd_config.erl b/src/ejabberd_config.erl index 6b0b70bef..b9b0f8ee7 100644 --- a/src/ejabberd_config.erl +++ b/src/ejabberd_config.erl @@ -71,6 +71,7 @@ start() -> [named_table, public, {read_concurrency, true}]), catch ets:new(ejabberd_db_modules, [named_table, public, {read_concurrency, true}]), + ext_mod:add_paths(), case load_file(ConfigFile) of {ok, State1} -> UnixTime = erlang:system_time(second), diff --git a/src/ext_mod.erl b/src/ext_mod.erl index 0d734e08c..328bb829e 100644 --- a/src/ext_mod.erl +++ b/src/ext_mod.erl @@ -32,7 +32,7 @@ -export([start_link/0, update/0, check/1, available_command/0, available/0, available/1, installed_command/0, installed/0, installed/1, - install/1, uninstall/1, upgrade/0, upgrade/1, + install/1, uninstall/1, upgrade/0, upgrade/1, add_paths/0, add_sources/1, add_sources/2, del_sources/1, modules_dir/0, config_dir/0, opt_type/1, get_commands_spec/0]). @@ -54,13 +54,16 @@ start_link() -> init([]) -> process_flag(trap_exit, true), - [code:add_patha(module_ebin_dir(Module)) - || {Module, _} <- installed()], + add_paths(), application:start(inets), inets:start(httpc, [{profile, ext_mod}]), ejabberd_commands:register_commands(get_commands_spec()), {ok, #state{}}. +add_paths() -> + [code:add_patha(module_ebin_dir(Module)) + || {Module, _} <- installed()]. + handle_call(_Request, _From, State) -> Reply = ok, {reply, Reply, State}. |