Example #1
0
  /**
   * Handles adding a chat room provider.
   *
   * @param provider the provider.
   * @param addQueryResult indicates whether we should add the chat room to the query results or
   *     fire an event without adding it to the results.
   */
  private void providerAdded(ChatRoomProviderWrapper provider, boolean addQueryResult) {

    for (int i = 0; i < provider.countChatRooms(); i++) {
      ChatRoomWrapper chatRoom = provider.getChatRoom(i);
      addChatRoom(
          provider.getProtocolProvider(),
          chatRoom.getChatRoomName(),
          chatRoom.getChatRoomID(),
          addQueryResult,
          chatRoom.isAutojoin());
    }
  }
Example #2
0
  @Override
  public void chatRoomProviderWrapperRemoved(ChatRoomProviderWrapper provider) {
    LinkedList<ChatRoomSourceContact> tmpContactResults;
    synchronized (contactResults) {
      tmpContactResults = new LinkedList<ChatRoomSourceContact>(contactResults);

      for (ChatRoomSourceContact contact : tmpContactResults) {
        if (contact.getProvider().equals(provider.getProtocolProvider())) {
          contactResults.remove(contact);
          fireContactRemoved(contact);
        }
      }
    }
  }