25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-10-03 14:45:16 +02:00

Process on_user_offline only from valid sessions

This commit is contained in:
Christophe Romain 2017-08-11 12:05:14 +02:00
parent 35eeaa5869
commit 7a90cda8ff

View File

@ -593,9 +593,10 @@ on_user_online(C2SState) ->
C2SState.
-spec on_user_offline(ejabberd_c2s:state(), atom()) -> ejabberd_c2s:state().
on_user_offline(C2SState, _Reason) ->
JID = maps:get(jid, C2SState),
on_user_offline(#{jid := JID} = C2SState, _Reason) ->
purge_offline(jid:tolower(JID)),
C2SState;
on_user_offline(C2SState, _Reason) ->
C2SState.
%% -------