QTfrontend/net/newnetclient.cpp
changeset 15909 7409084d891f
parent 15908 014f4edd0421
child 15915 35d26863a88e
--- a/QTfrontend/net/newnetclient.cpp	Sun Oct 16 13:14:16 2022 +0300
+++ b/QTfrontend/net/newnetclient.cpp	Sun Oct 16 20:15:57 2022 +0300
@@ -474,13 +474,37 @@
         return;
     }
 
+    if (lst[0] == "MSG" || lst[0] == "MSG_ECHO")
+    {
+        if(lst.size() < 3)
+        {
+            qWarning("Net: Empty MSG message");
+            return;
+        }
+
+        bool isEcho = lst[0] == "MSG_ECHO";
+        QString nick = lst[1];
+        QString message = lst[2];
+
+        if (netClientState == InLobby)
+        {
+            emit lobbyDirectMessage(nick, message, isEcho);
+        }
+        else
+        {
+            emit chatStringFromNet(HWProto::formatDirectMsg(mynick, nick, message, isEcho));
+            emit roomDirectMessage(nick, message, isEcho);
+        }
+        return;
+    }
+
     if (netClientState == InRoom || netClientState == InGame || netClientState == InDemo)
     {
         if (lst[0] == "TEAMDRAW")
         {
             if(lst.size() < 3)
             {
-                qWarning("Net: Empty CHAT message");
+                qWarning("Net: Empty TEAMDRAW message");
                 return;
             }