예제 #1
0
 /**
  * to rename the user in all the channels
  *
  * @param sOldNickName the old nickname
  * @param sNewNickName the new nickname
  */
 public void rename(String sOldNickName, String sNewNickName) {
   for (int i = 0; i < channelList.size(); i++) {
     try {
       HandleChannel.renameUser(sOldNickName, sNewNickName, getChannelAt(i));
     } catch (IRCException e) {
     }
   }
 }
예제 #2
0
 /** to get all the list of channels which contain the current user */
 public Channel[] getChannels() {
   Vector vAllChannels = new Vector();
   for (int i = 0; i < channelList.size(); i++) {
     try {
       vAllChannels.addElement(HandleChannel.getChannel((String) channelList.get(i)));
     } catch (Exception e) {
     }
   }
   Channel[] channels = new Channel[vAllChannels.size()];
   return (Channel[]) vAllChannels.toArray(channels);
 }
예제 #3
0
 /** to remove the user from all the channels */
 public void remove() {
   for (int i = 0; i < channelList.size(); i++) {
     try {
       HandleChannel.removeUser(
           this,
           getChannelAt(i),
           true,
           getUserFullName(),
           new Quit().getName(),
           VOID,
           Config.getValue("command.quit.default.message", "Bye bye"));
     } catch (IRCException e) {
     }
   }
 }
예제 #4
0
 /**
  * to get the displayed value of a specific channel for a specific user
  *
  * @param sChannelName the name of the channel to display
  * @param sAskerNickName the nickname of the user who is asking for
  */
 private String getDisplayedValue(String sChannelName, String sAskerNickName) {
   try {
     Channel channel = HandleChannel.getChannel(sChannelName);
     Rights rights = channel.getRights(nickName);
     if ((channel.isUserOn(sAskerNickName))
         || (!channel.isTypePrivate() && !channel.isTypeSecret())) {
       if (rights.isOperator()) {
         return CHANNEL_IS_OPERATOR + sChannelName;
       } else if (rights.isAbleToSpeakIfModerated()) {
         return CHANNEL_CAN_SPEAK_ON_MODERATED + sChannelName;
       } else {
         return sChannelName;
       }
     }
   } catch (IRCException e) {
   }
   return VOID;
 }