aboutsummaryrefslogtreecommitdiff
path: root/src/mod_time.erl
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-04-30 19:01:47 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-04-30 19:01:47 +0300
commitfddd6110e00df12c99a20a2cc9d074f5f4f1f965 (patch)
tree366575b855f1b2013db7eeb02ecb213f81c98c1f /src/mod_time.erl
parentMerge branch 'new-option-validation' (diff)
Don't validate an option in gen_mod:get*opt() functions
The changes are very similar to those from previous commit: * Now there is no need to pass validating function in gen_mod:get_opt() and gen_mod:get_module_opt() functions, because the modules' configuration keeps already validated values. * New functions gen_mod:get_opt/2 and gen_mod:get_module_opt/3 are introduced. * Functions gen_mod:get_opt/4 and get_module_opt/5 are deprecated. If the functions are still called, the "function" argument is simply ignored. * Validating callback Mod:listen_opt_type/1 is introduced to validate listening options at startup.
Diffstat (limited to 'src/mod_time.erl')
-rw-r--r--src/mod_time.erl7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mod_time.erl b/src/mod_time.erl
index 0b5264889..ba167ad80 100644
--- a/src/mod_time.erl
+++ b/src/mod_time.erl
@@ -41,8 +41,7 @@
-include("xmpp.hrl").
start(Host, Opts) ->
- IQDisc = gen_mod:get_opt(iqdisc, Opts, fun gen_iq_handler:check_type/1,
- one_queue),
+ IQDisc = gen_mod:get_opt(iqdisc, Opts, one_queue),
gen_iq_handler:add_iq_handler(ejabberd_local, Host,
?NS_TIME, ?MODULE, process_local_iq, IQDisc).
@@ -51,9 +50,7 @@ stop(Host) ->
?NS_TIME).
reload(Host, NewOpts, OldOpts) ->
- case gen_mod:is_equal_opt(iqdisc, NewOpts, OldOpts,
- fun gen_iq_handler:check_type/1,
- one_queue) of
+ case gen_mod:is_equal_opt(iqdisc, NewOpts, OldOpts, one_queue) of
{false, IQDisc, _} ->
gen_iq_handler:add_iq_handler(ejabberd_local, Host, ?NS_TIME,
?MODULE, process_local_iq, IQDisc);