public void processBye(RequestEvent requestEvent, ServerTransaction serverTransaction) { try { logger.debug("DEBUG: IMByeProcessing, Processing BYE in progress..."); Request request = requestEvent.getRequest(); MessageFactory messageFactory = imUA.getMessageFactory(); InstantMessagingGUI instantMessagingGUI = imUA.getInstantMessagingGUI(); ListenerInstantMessaging listenerInstantMessaging = instantMessagingGUI.getListenerInstantMessaging(); ChatSessionManager chatSessionManager = listenerInstantMessaging.getChatSessionManager(); String buddy = IMUtilities.getKey(request, "From"); if (chatSessionManager.hasAlreadyChatSession(buddy)) { chatSessionManager.removeChatSession(buddy); // chatSession.setExitedSession(true,"Your contact has exited // the session"); } else { logger.debug("DEBUG: IMByeProcessing, processBye(), no active chatSession"); } // Send an OK Response response = messageFactory.createResponse(Response.OK, request); serverTransaction.sendResponse(response); logger.debug("DEBUG: IMByeProcessing, processBye(), OK replied to the BYE"); logger.debug("DEBUG: IMByeProcessing, Processing BYE completed..."); } catch (Exception ex) { ex.printStackTrace(); } }