Commit 9b7f488b authored by poixen's avatar poixen
Browse files

Merge pull request #559 from poixen/chatnamehighlight

Fixed #557
parents 7ef5f2d3 e4afd9fa
......@@ -171,16 +171,15 @@ void ChatView::appendMessage(QString message, QString sender, UserLevelFlags use
from = 1;
}
QTextCharFormat charFormat;
if (settingsCache->getChatMention()) {
if (message.toLower().contains("@" + QString::fromStdString(tabSupervisor->getUserInfo()->name()).toLower())) {
charFormat.setFontWeight(QFont::Bold);
charFormat.setForeground(QBrush(QColor(255, 120, 0)));
messageFormat.setFontWeight(QFont::Bold);
messageFormat.setForeground(QBrush(QColor(255, 120, 0)));
}
}
if (!message.isEmpty())
cursor.insertText(message, charFormat);
cursor.insertText(message, messageFormat);
if (atBottom)
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment