diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2015-06-01 15:38:27 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2015-06-01 15:38:27 +0300 |
commit | fb6267f38ee47f3f725f88324d132741c85dfb6a (patch) | |
tree | d63c5efd207a736f9215d645ccb881bba942ed6a /src/mod_pres_counter.erl | |
parent | Do not try to fetch module options via eldap_utils (diff) |
Add config validation at startup
Diffstat (limited to '')
-rw-r--r-- | src/mod_pres_counter.erl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mod_pres_counter.erl b/src/mod_pres_counter.erl index e904ab95..840c3aae 100644 --- a/src/mod_pres_counter.erl +++ b/src/mod_pres_counter.erl @@ -27,7 +27,8 @@ -behavior(gen_mod). --export([start/2, stop/1, check_packet/6]). +-export([start/2, stop/1, check_packet/6, + mod_opt_type/1]). -include("ejabberd.hrl"). -include("logger.hrl"). @@ -119,3 +120,9 @@ update(Server, JID, Dir) -> read(K) -> get({pres_counter, K}). write(K, V) -> put({pres_counter, K}, V). + +mod_opt_type(count) -> + fun (I) when is_integer(I), I > 0 -> I end; +mod_opt_type(interval) -> + fun (I) when is_integer(I), I > 0 -> I end; +mod_opt_type(_) -> [count, interval]. |