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