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} =
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) ->