fix for keepalive and chat window
[xboard.git] / winboard / wchat.c
index 0fd5e08..a837a86 100644 (file)
@@ -177,11 +177,15 @@ LRESULT CALLBACK ChatProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
            GetDlgItemText(hDlg, OPT_ChatInput, mess, MSG_SIZ);\r
            SetDlgItemText(hDlg, OPT_ChatInput, "");\r
            // from here on it could be back-end\r
-           if(strcmp("WHISPER", chatPartner[partner])) {\r
-               sprintf(buf, "> %s\n", mess); // echo only tells, not whispers\r
+           if(!strcmp("WHISPER", chatPartner[partner]))\r
+               sprintf(buf, "whisper %s\n", mess); // WHISPER box uses "whisper" to send\r
+           else {\r
+               if(!atoi(chatPartner[partner])) {\r
+                   sprintf(buf, "> %s\n", mess); // echo only tells to handle, not channel\r
                InsertIntoMemo(hDlg, buf);\r
+               }\r
                sprintf(buf, "tell %s %s\n", chatPartner[partner], mess);\r
-           } else sprintf(buf, "whisper %s\n", mess); // SAY box uses "say" to send\r
+           }\r
            SendToICS(buf);\r
            break;\r
 \r