From b82b93f8f0c229e94a89469b0754bab0e28cd17c Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Sat, 29 Apr 2017 11:39:40 +0300 Subject: Don't validate an option in ejabberd_config:get_option() functions The commit introduces the following changes: * Now there is no need to pass validating function in ejabberd_config:get_option() functions, because the configuration keeps already validated values. * New function ejabberd_config:get_option/1 is introduced * Function ejabberd_config:get_option/3 is deprecated. If the function is still called, the second argument (validating function) is simply ignored. * The second argument for ejabberd_config:get_option/2 is now a default value, not a validating function. --- src/extauth.erl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/extauth.erl') diff --git a/src/extauth.erl b/src/extauth.erl index 6ec7e7760..c6f25102c 100644 --- a/src/extauth.erl +++ b/src/extauth.erl @@ -105,11 +105,7 @@ random_instance(MaxNum) -> randoms:uniform(MaxNum) - 1. get_instances(Server) -> - ejabberd_config:get_option( - {extauth_instances, Server}, - fun(V) when is_integer(V), V > 0 -> - V - end, 1). + ejabberd_config:get_option({extauth_instances, Server}, 1). loop(Port, Timeout, ProcessName, ExtPrg) -> receive -- cgit v1.2.3