/** * removes a user from the user list * * @param un the name of the user to be removed */ public void userDel(String un) { users.remove(users.indexOf(un)); if (ignores.contains(un)) { ignores.remove(ignores.indexOf(un)); } if (afks.contains(un)) { afks.remove(afks.indexOf(un)); } if (admins.contains(un)) { admins.remove(admins.indexOf(un)); } updateList(); serverMessage(un + " has left " + server.channel); privates.serverMessage(un, un + " has left"); }
/** * changes the name of a user, updating list of admins, afks, ignoes, and master user list * * @param on old username * @param nn new username */ public void rename(String on, String nn) { if (admins.contains(on)) { admins.remove(admins.indexOf(on)); admins.add(nn); } if (afks.contains(on)) { afks.remove(afks.indexOf(on)); afks.add(nn); } if (ignores.contains(on)) { ignores.remove(ignores.indexOf(on)); ignores.add(nn); } users.remove(on); users.add(nn); updateList(); serverMessage(on + " renamed to " + nn); }