From fddd6110e00df12c99a20a2cc9d074f5f4f1f965 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Sun, 30 Apr 2017 19:01:47 +0300 Subject: 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. --- src/mod_vcard_mnesia.erl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/mod_vcard_mnesia.erl') diff --git a/src/mod_vcard_mnesia.erl b/src/mod_vcard_mnesia.erl index 340f8928e..47072ed69 100644 --- a/src/mod_vcard_mnesia.erl +++ b/src/mod_vcard_mnesia.erl @@ -197,9 +197,7 @@ filter_fields([{SVar, [Val]} | Ds], Match, LServer) <<"user">> -> case gen_mod:get_module_opt(LServer, ?MODULE, search_all_hosts, - fun(B) when is_boolean(B) -> - B - end, true) of + true) of true -> Match#vcard_search{luser = make_val(LVal)}; false -> Host = find_my_host(LServer), -- cgit v1.2.3