QTfrontend/ui/widget/chatwidget.cpp
changeset 15909 7409084d891f
parent 15445 3207dd5fdfd2
--- a/QTfrontend/ui/widget/chatwidget.cpp	Sun Oct 16 13:14:16 2022 +0300
+++ b/QTfrontend/ui/widget/chatwidget.cpp	Sun Oct 16 20:15:57 2022 +0300
@@ -420,6 +420,17 @@
     printChatString(nick, linkedNick(nick) + ": " + messageToHTML(message), "Chat", containsHighlight(nick, message));
 }
 
+void HWChatWidget::onDirectMessage(const QString & nick, const QString & message, bool isEcho)
+{
+    if (isEcho)
+        printChatString(nick, "[msg] " + linkedNick(m_userNick) + ": " +
+                        messageToHTML(QString("/msg [%1] %2").arg(nick).arg(message)),
+                        "DirectMsg", false);
+    else
+        printChatString(nick, "[msg] " + linkedNick(nick) + ": " +
+                        messageToHTML(message), "DirectMsg", true);
+}
+
 void HWChatWidget::printChatString(
     const QString & nick, const QString & str, const QString & cssClassPart, bool highlight)
 {