diff options
author | Badlop <badlop@process-one.net> | 2019-03-13 11:07:13 +0100 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2019-03-13 11:28:31 +0100 |
commit | 629e568294c9ba07efeae50eaf22fa8cd96108b0 (patch) | |
tree | 515b52fb5ac9ed08e52c0c690163be38eff6206a /src | |
parent | mod_muc: Simplify room creation checks (diff) |
Delete the ping timer only when timeout_action=kill (#2820)
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_ping.erl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mod_ping.erl b/src/mod_ping.erl index 25d2b60ed..fd3a08909 100644 --- a/src/mod_ping.erl +++ b/src/mod_ping.erl @@ -131,10 +131,9 @@ handle_info({iq_reply, #iq{type = error}, JID}, State) -> handle_info({iq_reply, #iq{}, _JID}, State) -> {noreply, State}; handle_info({iq_reply, timeout, JID}, State) -> - Timers = del_timer(JID, State#state.timers), ejabberd_hooks:run(user_ping_timeout, State#state.host, [JID]), - case State#state.timeout_action of + Timers = case State#state.timeout_action of kill -> #jid{user = User, server = Server, resource = Resource} = @@ -143,8 +142,10 @@ handle_info({iq_reply, timeout, JID}, State) -> of Pid when is_pid(Pid) -> ejabberd_c2s:close(Pid, ping_timeout); _ -> ok - end; - _ -> ok + end, + del_timer(JID, State#state.timers); + _ -> + State#state.timers end, {noreply, State#state{timers = Timers}}; handle_info({timeout, _TRef, {ping, JID}}, State) -> |