From 9b6f97844a2da06269c133f7b8253f4c3548829f Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Sat, 20 Mar 2010 19:36:41 +0100 Subject: [PATCH] highlight message (red) if current nickname is used --- src/org/yaaic/irc/IRCConnection.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/org/yaaic/irc/IRCConnection.java b/src/org/yaaic/irc/IRCConnection.java index 52ad7c3..80cf028 100644 --- a/src/org/yaaic/irc/IRCConnection.java +++ b/src/org/yaaic/irc/IRCConnection.java @@ -161,6 +161,11 @@ public class IRCConnection extends PircBot Message message = new Message(sender + " " + action); message.setIcon(R.drawable.action); + if (action.contains(getNick())) { + // highlight + message.setColor(Message.COLOR_RED); + } + if (target.equals(this.getNick())) { // We are the target - this is an action in a query Conversation conversation = server.getConversation(sender); @@ -336,6 +341,12 @@ public class IRCConnection extends PircBot text = Colors.removeFormattingAndColors(text); Message message = new Message("<" + sender + "> " + text); + + if (text.contains(getNick())) { + // highlight + message.setColor(Message.COLOR_RED); + } + server.getConversation(target).addMessage(message); Intent intent = new Intent(Broadcast.CONVERSATION_MESSAGE); @@ -472,6 +483,10 @@ public class IRCConnection extends PircBot text = Colors.removeFormattingAndColors(text); Message message = new Message("<" + sender + "> " + text); + + if (text.contains(getNick())) { + message.setColor(Message.COLOR_RED); + } Conversation conversation = server.getConversation(sender);