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 { ...@@ -1015,17 +1015,21 @@ public class SessionManager extends BasicModule {
public void onConnectionClose(Object handback) { public void onConnectionClose(Object handback) {
try { try {
ClientSession session = (ClientSession)handback; ClientSession session = (ClientSession)handback;
if (session.getPresence().isAvailable()) { try {
// Send an unavailable presence to the user's subscribers if (session.getPresence().isAvailable()) {
// Note: This gives us a chance to send an unavailable presence to the // Send an unavailable presence to the user's subscribers
// entities that the user sent directed presences // Note: This gives us a chance to send an unavailable presence to the
Presence presence = new Presence(); // entities that the user sent directed presences
presence.setType(Presence.Type.unavailable); Presence presence = new Presence();
presence.setFrom(session.getAddress()); presence.setType(Presence.Type.unavailable);
presenceHandler.process(presence); presence.setFrom(session.getAddress());
presenceHandler.process(presence);
}
}
finally {
// Remove the session
removeSession(session);
} }
// Remove the session
removeSession(session);
} }
catch (Exception e) { catch (Exception e) {
// Can't do anything about this problem... // 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