Last active
November 6, 2017 23:06
-
-
Save oprypin/7fb4fe0cc2e62b03c72178ab6d1e7e73 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --unified --recursive konversation-1.7.2/src/viewer/chatwindow.cpp konversation-1.7.2.new/src/viewer/chatwindow.cpp | |
--- konversation-1.7.2/src/viewer/chatwindow.cpp 2017-05-09 17:29:00.000000000 +0200 | |
+++ konversation-1.7.2.new/src/viewer/chatwindow.cpp 2017-11-07 00:03:57.217338235 +0100 | |
@@ -278,7 +278,15 @@ | |
void ChatWindow::append(const QString& nickname, const QString& message, const QHash<QString, QString> &messageTags, const QString& label) | |
{ | |
if(!textView) return; | |
- textView->append(nickname, message, messageTags, label); | |
+ QString nickname_ = nickname; | |
+ QString message_ = message; | |
+ QRegExp boldNickname("^\x02<([^>]+)>\x0f (.*)$"); | |
+ if(nickname == "FromGitter" && boldNickname.indexIn(message) != -1) | |
+ { | |
+ nickname_ = "@" + boldNickname.capturedTexts()[1]; | |
+ message_ = boldNickname.capturedTexts()[2]; | |
+ } | |
+ textView->append(nickname_, message_, messageTags, label); | |
} | |
void ChatWindow::appendQuery(const QString& nickname, const QString& message, const QHash<QString, QString> &messageTags, bool inChannel) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment