Esempio n. 1
0
 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.");
   }
 }
Esempio n. 2
0
 @Override
 public void leaveMuc() throws RemoteException {
   if (isConnected() && muc != null) {
     muc.leave();
     muc = null;
     roomName = null;
     occupants = null;
   }
 }
Esempio n. 3
0
  /**
   * 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);
    }
  }