public final synchronized void create(String nickname) throws NoResponseException, XMPPErrorException, SmackException { if (this.joined) { throw new IllegalStateException("Creation failed - User already joined the room."); } else if (!createOrJoin(nickname)) { leave(); throw new SmackException("Creation failed - Missing acknowledge of room creation."); } }
@Override public void leaveMuc() throws RemoteException { if (isConnected() && muc != null) { muc.leave(); muc = null; roomName = null; occupants = null; } }
/** * leaves the muc and deletes its record from the db * * @param muc */ private void leaveRoom(MultiUserChat muc) throws SmackException.NotConnectedException { mMucHelper.deleteMUC(muc.getRoom()); if (muc.isJoined()) { muc.leave(); } // Remove the room if mRooms contains it if (mRooms.size() > 0) { Integer i = getRoomInt(muc.getRoom()); String number = mMucHelper.getNumber(muc.getRoom()); mRoomNumbers.remove(i); mRooms.remove(number); } }