From 104896b42d3350d996e885370f8cdec815b92df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Wed, 13 Jun 2012 23:01:20 +0200 Subject: [PATCH] made commands valid with ">" prefix rather than nickname --- src/de/ctdo/crashtest/irc/IrcClient.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/de/ctdo/crashtest/irc/IrcClient.java b/src/de/ctdo/crashtest/irc/IrcClient.java index 7870a37..4c10f2c 100644 --- a/src/de/ctdo/crashtest/irc/IrcClient.java +++ b/src/de/ctdo/crashtest/irc/IrcClient.java @@ -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) {