コード例 #1
0
  public void onUserJoined(IrcUser user) {
    userList.add(user);
    nickUserMap.put(user.nick, user);
    user.addObserver(this);

    updateTopic();
  }
コード例 #2
0
  public void setName(String networkName) {
    this.networkName = networkName;
    setChanged();
    notifyObservers();

    updateTopic();
  }
コード例 #3
0
  public void setUserList(List<IrcUser> userList) {
    if (userList != null && userList.size() > 0) {
      for (IrcUser user : userList) {
        user.deleteObserver(this);
      }
    }
    this.userList = userList;
    nickUserMap.clear();
    for (IrcUser user : userList) {
      nickUserMap.put(user.nick, user);
      user.addObserver(this);
    }

    updateTopic();
  }
コード例 #4
0
  public void onUserQuit(String nick) {
    nickUserMap.remove(nick);
    for (IrcUser user : userList) {
      if (user.nick.equals(nick)) {
        for (Buffer buffer : buffers.getBufferList(true)) {
          if (user.channels.contains(buffer.getInfo().name)) {
            buffer.getUsers().removeUserByNick(nick);
          }
        }
        userList.remove(user);
        user.deleteObserver(this);
        return;
      }
    }

    updateTopic();
  }
コード例 #5
0
  public void onUserParted(String nick, String bufferName) {
    for (IrcUser user : userList) {
      if (user.nick.equals(nick) && user.channels.contains(bufferName)) {
        user.channels.remove(bufferName);
        break;
      }
    }
    for (Buffer buffer : buffers.getBufferList(true)) {
      if (buffer.getInfo().name.equalsIgnoreCase(bufferName)) {
        buffer.getUsers().removeUserByNick(nick);
        if (nick.equalsIgnoreCase(getNick())) {
          buffer.setActive(false);
        }
        break;
      }
    }

    updateTopic();
  }
コード例 #6
0
  public void setServer(String server) {
    this.server = server;

    updateTopic();
  }
コード例 #7
0
  public void setLatency(int latency) {
    this.latency = latency;

    updateTopic();
  }