示例#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.");
   }
 }
示例#2
0
 @Override
 public void leaveMuc() throws RemoteException {
   if (isConnected() && muc != null) {
     muc.leave();
     muc = null;
     roomName = null;
     occupants = null;
   }
 }
示例#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);
    }
  }