diff -r 7a94005874c9 -r 8163c9aaad0c QTfrontend/chatwidget.cpp --- a/QTfrontend/chatwidget.cpp Tue Feb 01 07:52:50 2011 +0100 +++ b/QTfrontend/chatwidget.cpp Tue Feb 01 08:15:01 2011 +0100 @@ -325,6 +325,8 @@ onChatString("", str); } +const QRegExp HWChatWidget::URLREGEXP = QRegExp("(http://)?(www\\.)?(hedgewars\\.org(/[^ ]*)?)"); + void HWChatWidget::onChatString(const QString& nick, const QString& str) { bool isFriend = false; @@ -341,6 +343,8 @@ chatStrings.removeFirst(); QString formattedStr = Qt::escape(str.mid(1)); + // make hedgewars.org urls actual links + formattedStr = formattedStr.replace(URLREGEXP, "\\3"); // "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