/** * Is the sender respected in the channel? * * IOW, does he have a voice of a channel operator? */ private boolean isSenderAuthorized(String channel, String sender) { for (User u : getUsers(channel)) { System.out.println(u.getPrefix()+u.getNick()); if (u.getNick().equals(sender)) { String p = u.getPrefix(); if (p.contains("@") || p.contains("+")) return true; } } return false; }
public boolean isOp(String sender, String channel) { User users[] = getUsers(channel); User u = null; for (User user : users) { String us = user.getNick().replace("~", ""); System.out.println("user: "******"~")) { return true; } else { return false; } }
public boolean userIsOnChannel(final String nick, final String channel) { for (final User user : getUsers(channel)) { if (user.getNick().toLowerCase().equals(nick.toLowerCase())) { return true; } } return false; }
@Override protected void onUserList(String channel, User[] users) { for (User u : getUsers(channel)) { if (u.isOp()) { String nick = u.getNick(); if (!ops.contains(nick)) { ops.add(nick); } } } }
public void handleLoss(String nick) { for (String s : channels) { for (User u : getUsers(s)) { if (u.getNick().equals(nick)) { return; } } } Group removedGroup = Group.getGroup(nick); if (removedGroup != null) { groups.remove(removedGroup); } }
public User playerMatchIRC(String name) { if (getServer().getOnlinePlayers().length < 1) { return null; } for (User user : getIrcBot().getUsers("#hardwork")) { if (user.getNick().equalsIgnoreCase(name)) { return user; } } return null; }
public boolean isVoice(String sender, String channel) { User users[] = getUsers(channel); User u = null; for (User usa : users) { if (sender.equals(usa.getNick())) { u = usa; break; } } if (u.hasVoice()) { return true; } else { return false; } }
/** * Get all channels where the user with the given nickname is online * * @param nickname * @return Array of channel names */ private Vector<String> getChannelsByNickname(String nickname) { Vector<String> channels = new Vector<String>(); String[] channelArray = getChannels(); for (String channel : channelArray) { User[] userArray = getUsers(channel); for (User user : userArray) { if (user.getNick().equals(nickname)) { channels.add(channel); break; } } } return channels; }