ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/client/alerters/IRC__Alerter.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/client/alerters/IRC__Alerter.java (file contents):
Revision 1.30.2.4 by tdb, Tue Feb 5 21:40:03 2002 UTC vs.
Revision 1.31 by tdb, Thu Feb 7 17:15:19 2002 UTC

# Line 267 | Line 267 | public class IRC__Alerter extends AlerterSkeleton {
267              
268              // put these details into the bot
269              this.setLogin(user);
270 <            this.setVersion(comment);
270 >            this.setVersion("[" + getRevision() + "] " + comment);
271              this.setFinger(finger);
272              
273              // attempt to connect, trying each nickname
# Line 410 | Line 410 | public class IRC__Alerter extends AlerterSkeleton {
410          public void onNickChange(String oldNick, String login, String hostname, String newNick) {
411              if(oldNick.equals(_nickname)) {
412                  _nickname = newNick;
413 +                // tell the underlying pircbot that our nick has changed too :)
414 +                setName(newNick);
415              }
416          }
417          
# Line 448 | Line 450 | public class IRC__Alerter extends AlerterSkeleton {
450           * This method handles input directed to us, and
451           * responds accordingly if required.
452           *
451         * nb. matching user input is quite bad right now,
452         *     and should be improved one day.
453         *
453           * @param message the message from someone
454           * @param source where the message came from, so we know where to send the response
455           */
# Line 479 | Line 478 | public class IRC__Alerter extends AlerterSkeleton {
478                  return;
479              }
480              
482            // see if the message matches (loosely!) any
483            // of our known commands
481              if(message.equalsIgnoreCase(stopCommand)) {
482                  _active = false;
483                  sendMessage(source, "alerts have been stopped");
# Line 511 | Line 508 | public class IRC__Alerter extends AlerterSkeleton {
508                  }
509                  
510              }
511 <            else if(message.equalsIgnoreCase(joinCommand)) {
511 >            else if(message.toLowerCase().startsWith(joinCommand.toLowerCase())) {
512                  String joinCmd = joinCommand;
513                  String newChan = message.substring(message.indexOf(joinCmd) + joinCmd.length() + 1);
514                  int endOfChan = newChan.indexOf(" ");
# Line 527 | Line 524 | public class IRC__Alerter extends AlerterSkeleton {
524                      _channel = newChan;
525                  }
526              }
527 <            else if(message.equalsIgnoreCase(nickChangeCommand)) {
527 >            else if(message.toLowerCase().startsWith(nickChangeCommand.toLowerCase())) {
528                  String nickChangeCmd = nickChangeCommand;
529                  String newNick = message.substring(message.indexOf(nickChangeCmd) + nickChangeCmd.length() + 1);
530                  int endOfNick = newNick.indexOf(" ");
# Line 538 | Line 535 | public class IRC__Alerter extends AlerterSkeleton {
535                  changeNick(newNick);
536              }
537              else if(message.equalsIgnoreCase(versionCommand)) {
538 <                sendMessage(source, "I am version "+REVISION.substring(11, REVISION.length()-2)+" of the i-scream alerting bot");
538 >                sendMessage(source, "I am version " + getRevision() + " of the i-scream alerting bot");
539              }
540              else if(message.equalsIgnoreCase(helpCommand)) {
541                  sendMessage(source, "Hello, I am the i-scream alerting bot version "+REVISION.substring(11, REVISION.length() -2));
# Line 627 | Line 624 | public class IRC__Alerter extends AlerterSkeleton {
624              try {
625                  Thread.sleep(delayTime * 1000);
626              } catch (InterruptedException e) {}
627 +        }
628 +        
629 +        /**
630 +         * Returns the revision of the bot.
631 +         *
632 +         * @return the revision of this bot
633 +         */
634 +        private String getRevision() {
635 +            return REVISION.substring(11, REVISION.length()-2);
636          }
637          
638          /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines