ejabberd - Comments for "Catch client disconnect" https://www.ejabberd.im/node/4874 en shk wrote: I run ejabberd and https://www.ejabberd.im/node/4874#comment-57673 <div class="quote-msg"> <div class="quote-author"><em>shk</em> wrote:</div> <p>I run ejabberd and bot written in erlang/exmpp. I connect to this bot some jabber clients. How can i catch client disconnect?</p></div> <pre> --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -1428,6 +1428,7 @@ print_state(State = #state{pres_t = T, pres_f = F, pres_a = A, pres_i = I}) -&gt; %% Returns: any %%---------------------------------------------------------------------- terminate(_Reason, StateName, StateData) -&gt; + ?INFO_MSG("Session closing: ~n~p", [StateData#state.jid]), case StateName of session_established -&gt; case StateData#state.authenticated of </pre> Tue, 02 Aug 2011 14:32:43 +0000 mfoss comment 57673 at https://www.ejabberd.im