# HG changeset patch
# User sheepluva
# Date 1319402879 -7200
# Node ID 4f234aa06182d2e0c772657d60734c03ab08dbaf
# Parent  7c34bf4fbb5485e5ccd0f40e5611950ce978969f
highlight improvements
* only highlight if surrounded by whitespaces (or trailing ': ')
+ case-insensitive

diff -r 7c34bf4fbb54 -r 4f234aa06182 QTfrontend/ui/widget/chatwidget.cpp
--- a/QTfrontend/ui/widget/chatwidget.cpp	Sun Oct 23 14:44:19 2011 -0400
+++ b/QTfrontend/ui/widget/chatwidget.cpp	Sun Oct 23 22:47:59 2011 +0200
@@ -466,7 +466,14 @@
                 cssClass = "msg_FriendChat";
     }
 
-    addLine(cssClass, formattedStr, (!nick.isEmpty()) && str.contains(m_userNick));
+    bool isHL = (!nick.isEmpty() &&
+                (nick != m_userNick) &&
+                str.toLower().contains(
+                        QRegExp(QString("^(.* )?%1(( |: ).*)?$").
+                            arg(QRegExp::escape(m_userNick).toLower())))
+                );
+
+    addLine(cssClass, formattedStr, isHL);
 }
 
 void HWChatWidget::addLine(const QString & cssClass, QString line, bool isHighlight)