コード例 #1
0
ファイル: ChatRoomQuery.java プロジェクト: vincentlao/jitsi
  /**
   * 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());
    }
  }
コード例 #2
0
ファイル: ChatRoomQuery.java プロジェクト: vincentlao/jitsi
  @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);
        }
      }
    }
  }