diff options
Diffstat (limited to '')
-rw-r--r-- | src/mod_ping.erl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mod_ping.erl b/src/mod_ping.erl index 9ba9833e..0b332ede 100644 --- a/src/mod_ping.erl +++ b/src/mod_ping.erl @@ -56,9 +56,8 @@ -export([init/1, terminate/2, handle_call/3, handle_cast/2, handle_info/2, code_change/3]). -%% Hook callbacks -export([iq_ping/3, user_online/3, user_offline/3, - user_send/3]). + user_send/3, mod_opt_type/1]). -record(state, {host = <<"">>, @@ -246,3 +245,15 @@ cancel_timer(TRef) -> receive {timeout, TRef, _} -> ok after 0 -> ok end; _ -> ok end. + +mod_opt_type(iqdisc) -> fun gen_iq_handler:check_type/1; +mod_opt_type(ping_interval) -> + fun (I) when is_integer(I), I > 0 -> I end; +mod_opt_type(send_pings) -> + fun (B) when is_boolean(B) -> B end; +mod_opt_type(timeout_action) -> + fun (none) -> none; + (kill) -> kill + end; +mod_opt_type(_) -> + [iqdisc, ping_interval, send_pings, timeout_action]. |