QTfrontend/ui/widget/chatwidget.cpp
changeset 6193 4f234aa06182
parent 6182 d56d18802481
child 6194 32b7e0ece99a
--- 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)