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.5 by tdb, Tue Feb 5 22:39:29 2002 UTC vs.
Revision 1.32 by tdb, Sat May 18 18:16:00 2002 UTC

# Line 1 | Line 1
1 + /*
2 + * i-scream central monitoring system
3 + * Copyright (C) 2000-2002 i-scream
4 + *
5 + * This program is free software; you can redistribute it and/or
6 + * modify it under the terms of the GNU General Public License
7 + * as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * This program is distributed in the hope that it will be useful,
11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 + * GNU General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU General Public License
16 + * along with this program; if not, write to the Free Software
17 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 + */
19 +
20   //---PACKAGE DECLARATION---
21   package uk.org.iscream.cms.server.client.alerters;
22  
# Line 410 | Line 429 | public class IRC__Alerter extends AlerterSkeleton {
429          public void onNickChange(String oldNick, String login, String hostname, String newNick) {
430              if(oldNick.equals(_nickname)) {
431                  _nickname = newNick;
432 +                // tell the underlying pircbot that our nick has changed too :)
433 +                setName(newNick);
434              }
435          }
436          
# Line 448 | Line 469 | public class IRC__Alerter extends AlerterSkeleton {
469           * This method handles input directed to us, and
470           * responds accordingly if required.
471           *
451         * nb. matching user input is quite bad right now,
452         *     and should be improved one day.
453         *
472           * @param message the message from someone
473           * @param source where the message came from, so we know where to send the response
474           */
# Line 479 | Line 497 | public class IRC__Alerter extends AlerterSkeleton {
497                  return;
498              }
499              
482            // see if the message matches (loosely!) any
483            // of our known commands
500              if(message.equalsIgnoreCase(stopCommand)) {
501                  _active = false;
502                  sendMessage(source, "alerts have been stopped");
# Line 511 | Line 527 | public class IRC__Alerter extends AlerterSkeleton {
527                  }
528                  
529              }
530 <            else if(message.equalsIgnoreCase(joinCommand)) {
530 >            else if(message.toLowerCase().startsWith(joinCommand.toLowerCase())) {
531                  String joinCmd = joinCommand;
532                  String newChan = message.substring(message.indexOf(joinCmd) + joinCmd.length() + 1);
533                  int endOfChan = newChan.indexOf(" ");
# Line 527 | Line 543 | public class IRC__Alerter extends AlerterSkeleton {
543                      _channel = newChan;
544                  }
545              }
546 <            else if(message.equalsIgnoreCase(nickChangeCommand)) {
546 >            else if(message.toLowerCase().startsWith(nickChangeCommand.toLowerCase())) {
547                  String nickChangeCmd = nickChangeCommand;
548                  String newNick = message.substring(message.indexOf(nickChangeCmd) + nickChangeCmd.length() + 1);
549                  int endOfNick = newNick.indexOf(" ");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines