diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-08-24 21:40:54 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-08-24 21:40:54 +0300 |
commit | 30bca124f452f42c1a5d2c0e1c7827bbf59c75b2 (patch) | |
tree | 833a2e55b1f6a352a966c24ae805d5140172d039 /src | |
parent | Fix 'make install' to work with new output from rebar list-deps (diff) |
Add forgotten caching options to the validator (thanks to Jan Pinkas)
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_announce.erl | 10 | ||||
-rw-r--r-- | src/mod_privacy.erl | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/mod_announce.erl b/src/mod_announce.erl index 39d68406f..7d25168cc 100644 --- a/src/mod_announce.erl +++ b/src/mod_announce.erl @@ -913,4 +913,12 @@ import(LServer, {sql, _}, DBType, Tab, List) -> mod_opt_type(access) -> fun acl:access_rules_validator/1; mod_opt_type(db_type) -> fun(T) -> ejabberd_config:v_db(?MODULE, T) end; -mod_opt_type(_) -> [access, db_type]. +mod_opt_type(O) when O == cache_life_time; O == cache_size -> + fun (I) when is_integer(I), I > 0 -> I; + (infinity) -> infinity + end; +mod_opt_type(O) when O == use_cache; O == cache_missed -> + fun (B) when is_boolean(B) -> B end; +mod_opt_type(_) -> + [access, db_type, cache_life_time, cache_size, + use_cache, cache_missed]. diff --git a/src/mod_privacy.erl b/src/mod_privacy.erl index 343645ff7..c4a1c471d 100644 --- a/src/mod_privacy.erl +++ b/src/mod_privacy.erl @@ -846,4 +846,12 @@ depends(_Host, _Opts) -> mod_opt_type(db_type) -> fun(T) -> ejabberd_config:v_db(?MODULE, T) end; mod_opt_type(iqdisc) -> fun gen_iq_handler:check_type/1; -mod_opt_type(_) -> [db_type, iqdisc]. +mod_opt_type(O) when O == cache_life_time; O == cache_size -> + fun (I) when is_integer(I), I > 0 -> I; + (infinity) -> infinity + end; +mod_opt_type(O) when O == use_cache; O == cache_missed -> + fun (B) when is_boolean(B) -> B end; +mod_opt_type(_) -> + [db_type, iqdisc, cache_life_time, cache_size, + use_cache, cache_missed]. |