mirror of
https://github.com/processone/ejabberd
synced 2025-10-06 03:50:15 +02:00
Reload modules when reloading configuration file
This commit is contained in:
parent
ff67860cdb
commit
3c4057ff55
48 changed files with 1084 additions and 298 deletions
|
@ -29,7 +29,7 @@
|
|||
|
||||
-protocol({xep, 191, '1.2'}).
|
||||
|
||||
-export([start/2, stop/1, process_iq/1, mod_opt_type/1, depends/2,
|
||||
-export([start/2, stop/1, reload/3, process_iq/1, mod_opt_type/1, depends/2,
|
||||
disco_features/5]).
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
|
@ -56,6 +56,17 @@ stop(Host) ->
|
|||
ejabberd_hooks:delete(disco_local_features, Host, ?MODULE, disco_features, 50),
|
||||
gen_iq_handler:remove_iq_handler(ejabberd_sm, Host, ?NS_BLOCKING).
|
||||
|
||||
reload(Host, NewOpts, OldOpts) ->
|
||||
case gen_mod:is_equal_opt(iqdisc, NewOpts, OldOpts,
|
||||
fun gen_iq_handler:check_type/1,
|
||||
one_queue) of
|
||||
{false, IQDisc, _} ->
|
||||
gen_iq_handler:add_iq_handler(ejabberd_sm, Host, ?NS_BLOCKING,
|
||||
?MODULE, process_iq, IQDisc);
|
||||
true ->
|
||||
ok
|
||||
end.
|
||||
|
||||
depends(_Host, _Opts) ->
|
||||
[{mod_privacy, hard}].
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue