X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwchat.c;h=db9ebf17282b95dbba1ee656137555d428da5256;hb=76d2f540a0bc0a54bbb2aba5e29d5412e7f2191c;hp=0fd5e08b2282de6ab9c0771396cf34e69c7998f5;hpb=18fc21bfe47cf80d294fffc22eb00d7f4384cd62;p=xboard.git diff --git a/winboard/wchat.c b/winboard/wchat.c index 0fd5e08..db9ebf1 100644 --- a/winboard/wchat.c +++ b/winboard/wchat.c @@ -99,9 +99,7 @@ static void ResizeWindowControls( HWND hDlg ) int clientHeight; int maxControlWidth; int buttonWidth, buttonHeight; -#if 0 -} -#else + /* Initialize variables */ GetClientRect( hDlg, &rc ); @@ -121,7 +119,6 @@ static void ResizeWindowControls( HWND hDlg ) // InvalidateRect( GetDlgItem(hDlg,IDC_EngineMemo1), NULL, FALSE ); // InvalidateRect( GetDlgItem(hDlg,IDC_EngineMemo2), NULL, FALSE ); } -#endif // front end. Actual printing of PV lines into the output field static void InsertIntoMemo( HANDLE hDlg, char * text ) @@ -177,11 +174,15 @@ LRESULT CALLBACK ChatProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam GetDlgItemText(hDlg, OPT_ChatInput, mess, MSG_SIZ); SetDlgItemText(hDlg, OPT_ChatInput, ""); // from here on it could be back-end - if(strcmp("WHISPER", chatPartner[partner])) { - sprintf(buf, "> %s\n", mess); // echo only tells, not whispers + if(!strcmp("WHISPER", chatPartner[partner])) + sprintf(buf, "whisper %s\n", mess); // WHISPER box uses "whisper" to send + else { + if(!atoi(chatPartner[partner])) { + sprintf(buf, "> %s\n", mess); // echo only tells to handle, not channel InsertIntoMemo(hDlg, buf); + } sprintf(buf, "tell %s %s\n", chatPartner[partner], mess); - } else sprintf(buf, "whisper %s\n", mess); // SAY box uses "say" to send + } SendToICS(buf); break;