Commit b3f37cdb authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Remove the session even if an error occurs while processing the unavailable presence.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1315 b35dd754-fafc-0310-a699-88a17e54d16e
parent 43bb57e8
......@@ -1015,17 +1015,21 @@ public class SessionManager extends BasicModule {
public void onConnectionClose(Object handback) {
try {
ClientSession session = (ClientSession)handback;
if (session.getPresence().isAvailable()) {
// Send an unavailable presence to the user's subscribers
// Note: This gives us a chance to send an unavailable presence to the
// entities that the user sent directed presences
Presence presence = new Presence();
presence.setType(Presence.Type.unavailable);
presence.setFrom(session.getAddress());
presenceHandler.process(presence);
try {
if (session.getPresence().isAvailable()) {
// Send an unavailable presence to the user's subscribers
// Note: This gives us a chance to send an unavailable presence to the
// entities that the user sent directed presences
Presence presence = new Presence();
presence.setType(Presence.Type.unavailable);
presence.setFrom(session.getAddress());
presenceHandler.process(presence);
}
}
finally {
// Remove the session
removeSession(session);
}
// Remove the session
removeSession(session);
}
catch (Exception e) {
// Can't do anything about this problem...
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment