CVS commit by strojil: Fix for the previous "fix" Only add prefix if it is not already there (is there a better way? negative lookbehind?) M +3 -2 kopetemessage.cpp 1.118 --- kdenonbeta/kopete/libkopete/kopetemessage.cpp #1.117:1.118 @@ -480,6 +480,7 @@ QString KopeteMessage::parseLinks( const //Replace http/https/ftp links - result.replace( QRegExp( QString::fromLatin1("\\b((http://\\w|ftp://\\w|https://\\w)[-\\w\\._]+[-\\w\\./#&;:=\\?~%_,]*)\\b") ), QString::fromLatin1("\\1" ) ); - result.replace( QRegExp( QString::fromLatin1("\\b((www\\.)[-\\w\\._]+[-\\w\\./#&;:=\\?~%_,]*)\\b") ), QString::fromLatin1("\\1" ) ); + result.replace( QRegExp( QString::fromLatin1("\\b((http(s?)://\\w|ftp://\\w)[-\\w\\._]+[-\\w\\./#&;:=\\?~%_,]*)\\b") ), QString::fromLatin1("\\1" ) ); + result.replace( QRegExp( QString::fromLatin1("^(www\\.[-\\w\\._]+[-\\w\\./#&;:=\\?~%_,]*)\\b") ), QString::fromLatin1("\\1" ) ); + result.replace( QRegExp( QString::fromLatin1("([^/])\\b(www\\.[-\\w\\._]+[-\\w\\./#&;:=\\?~%_,]*)\\b") ), QString::fromLatin1("\\1\\2" ) );