aboutsummaryrefslogtreecommitdiff
path: root/src/mod_pres_counter.erl
diff options
context:
space:
mode:
authorEvgeny Khramtsov <ekhramtsov@process-one.net>2019-06-14 12:33:26 +0300
committerEvgeny Khramtsov <ekhramtsov@process-one.net>2019-06-14 12:33:26 +0300
commita02cff0e780bb735531594c4ece81e8628f79782 (patch)
tree6fe7d8219d14f58183be1741fcea262c216db447 /src/mod_pres_counter.erl
parentReturn jid_malformed error when sending presence without nick to conference (diff)
Use new configuration validator
Diffstat (limited to '')
-rw-r--r--src/mod_pres_counter.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mod_pres_counter.erl b/src/mod_pres_counter.erl
index 6c1290469..9c50eb104 100644
--- a/src/mod_pres_counter.erl
+++ b/src/mod_pres_counter.erl
@@ -78,8 +78,8 @@ check_packet(Acc, _, _, _) ->
Acc.
update(Server, JID, Dir) ->
- StormCount = gen_mod:get_module_opt(Server, ?MODULE, count),
- TimeInterval = gen_mod:get_module_opt(Server, ?MODULE, interval),
+ StormCount = mod_pres_counter_opt:count(Server),
+ TimeInterval = mod_pres_counter_opt:interval(Server),
TimeStamp = erlang:system_time(second),
case read(Dir) of
undefined ->
@@ -123,9 +123,9 @@ 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;
+ econf:pos_int();
mod_opt_type(interval) ->
- fun (I) when is_integer(I), I > 0 -> I end.
+ econf:pos_int().
mod_options(_) ->
[{count, 5}, {interval, 60}].