String status = mMyPresence.getStatus(); try { setMyPresence(null, new IMPresence(Show.OFFLINE, (byte)1,status)); } catch(ServiceException e) { ZimbraLog.im.debug("ServiceException when going offline", e); }
mIsOnline = false;
    public synchronized void removeListener(Session session) {        mListeners.remove(session);        if (mListeners.size() == 0) {            String status = mMyPresence.getStatus();            try {                setMyPresence(null, new IMPresence(Show.OFFLINE, (byte)1,status));            } catch(ServiceException e) {                ZimbraLog.im.debug("ServiceException when going offline", e);            }        }    }