chat: don't link own name
authorsheepluva
Fri, 28 Oct 2011 09:12:05 +0200
changeset 6221 f3ac3e51418b
parent 6220 39782c4d9246
child 6222 96d10dcd6d84
chat: don't link own name
QTfrontend/ui/widget/chatwidget.cpp
--- a/QTfrontend/ui/widget/chatwidget.cpp	Fri Oct 28 03:41:52 2011 +0200
+++ b/QTfrontend/ui/widget/chatwidget.cpp	Fri Oct 28 09:12:05 2011 +0200
@@ -479,7 +479,12 @@
     // "link" nick, but before that encode it in base64 to make sure it can't intefere with html/url syntax
     // the nick is put as querystring as putting it as host would convert it to it's lower case variant
     if(!nick.isEmpty())
-        formattedStr.replace("|nick|",QString("<a href=\"hwnick://?%1\" class=\"nick\">%2</a>").arg(QString(nick.toUtf8().toBase64())).arg(nick));
+    {
+        if (nick != m_userNick)
+            formattedStr.replace("|nick|",QString("<a href=\"hwnick://?%1\" class=\"nick\">%2</a>").arg(QString(nick.toUtf8().toBase64())).arg(nick));
+        else
+            formattedStr.replace("|nick|", QString("<span class=\"nick\">%1</span>").arg(nick));
+    }
 
     QString cssClass("msg_UserChat");