This commit is contained in:
Matt Lowe 2015-01-17 00:08:54 +01:00
parent f1a9401416
commit e4afd9fa4d

View file

@ -171,16 +171,15 @@ void ChatView::appendMessage(QString message, QString sender, UserLevelFlags use
from = 1; from = 1;
} }
QTextCharFormat charFormat;
if (settingsCache->getChatMention()) { if (settingsCache->getChatMention()) {
if (message.toLower().contains("@" + QString::fromStdString(tabSupervisor->getUserInfo()->name()).toLower())) { if (message.toLower().contains("@" + QString::fromStdString(tabSupervisor->getUserInfo()->name()).toLower())) {
charFormat.setFontWeight(QFont::Bold); messageFormat.setFontWeight(QFont::Bold);
charFormat.setForeground(QBrush(QColor(255, 120, 0))); messageFormat.setForeground(QBrush(QColor(255, 120, 0)));
} }
} }
if (!message.isEmpty()) if (!message.isEmpty())
cursor.insertText(message, charFormat); cursor.insertText(message, messageFormat);
if (atBottom) if (atBottom)
verticalScrollBar()->setValue(verticalScrollBar()->maximum()); verticalScrollBar()->setValue(verticalScrollBar()->maximum());