From 56e156a65a7d5ee6160c529594a816e61793db82 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Wed, 23 May 2012 09:19:50 +0000 Subject: [PATCH] Fixed replacing of %color% in ChatStyle. It should not be replaced after %message%. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5182 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/chat/ChatStyle.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatStyle.cpp b/retroshare-gui/src/gui/chat/ChatStyle.cpp index 2041ecf7c..29c69d466 100644 --- a/retroshare-gui/src/gui/chat/ChatStyle.cpp +++ b/retroshare-gui/src/gui/chat/ChatStyle.cpp @@ -301,8 +301,8 @@ QString ChatStyle::formatMessage(enumFormatMessage type, const QString &name, co m_style[type] = style; } - QColor color; #ifdef COLORED_NICKNAMES + QColor color; if (flag & CHAT_FORMATMSG_SYSTEM) { color = Qt::darkBlue; } else { @@ -326,8 +326,10 @@ QString ChatStyle::formatMessage(enumFormatMessage type, const QString &name, co QString formatMsg = style.replace("%name%", name) .replace("%date%", timestamp.date().toString("dd.MM.yyyy")) .replace("%time%", timestamp.time().toString("hh:mm:ss")) - .replace("%message%", message) - .replace("%color%", color.name()); +#ifdef COLORED_NICKNAMES + .replace("%color%", color.name()) +#endif + .replace("%message%", message); return formatMsg; }