made commands valid with ">" prefix rather than nickname

This commit is contained in:
Lucas Pleß 2012-06-13 23:01:20 +02:00
parent 51f32a5e7a
commit 104896b42d
1 changed files with 8 additions and 2 deletions

View File

@ -49,8 +49,14 @@ public class IrcClient implements IIrcClient, jerklib.events.listeners.IRCEventL
String message = cme.getMessage();
final String nick = ircsession.getNick();
if(message.contains(nick)) {
message = message.substring(Math.max(nick.length(), message.indexOf(":")+1));
if(message.startsWith(nick) || message.startsWith(">")) {
if(message.startsWith(nick)) {
message = message.substring(Math.max(nick.length(), message.indexOf(":")+1));
}
else {
message = message.substring(1);
}
message = message.trim();
for(IRCEventListener listenerIRC : listenerListIRC) {