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 |
|
|
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 |
|
|
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 |
|
*/ |
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"); |
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(" "); |
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(" "); |