protected void messageReceived(MsnSession session) { super.messageReceived(session); int waitSeconds = getWaitSeconds(); if (waitSeconds > 0) { session.setSessionTimeout(waitSeconds * 1000); } else { session.setSessionTimeout(60 * 1000); // We can make sure the connection is OK } }
@Override protected void messageReceived(MsnSession session) { super.messageReceived(session); MsnContactImpl contact = (MsnContactImpl) session.getMessenger().getContactList().getContactByEmail(getEmail()); if (contact != null) { contact.setDisplayName(getDisplayName()); contact.setClientId(MsnClientId.parseInt(getClientId())); contact.setStatus(getUserStatus()); MsnObject obj = getMsnObject(); if (obj != null) { contact.setAvatar(obj); } ((AbstractMessenger) session.getMessenger()).fireContactStatusChanged(contact); } }
@Override protected void messageReceived(MsnSession session) { super.messageReceived(session); MsnSwitchboard switchboard = session.getSwitchboard(); if (switchboard != null) { MsnMessenger messenger = session.getMessenger(); MsnContactImpl contact = (MsnContactImpl) messenger.getContactList().getContactByEmail(getEmail()); if (contact == null) { contact = new MsnContactImpl(messenger.getContactList()); contact.setEmail(getEmail()); } ((AbstractSwitchboard) switchboard).removeContact(contact); ((AbstractMessenger) messenger).fireContactLeaveSwitchboard(switchboard, contact); if (switchboard.getAllContacts().length == 0) { switchboard.close(); } } }