X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwchat.c;h=99c5f3162d9e7c52a4792132ace9f06323c2927f;hb=f7324da94fc4494b39e66ba20e8d4d4d011fb73e;hp=81e190d86db807c04f64cb0ec9d4155004772635;hpb=dcfab363332520fedcd4e6e8c791a854ba548e83;p=xboard.git diff --git a/winboard/wchat.c b/winboard/wchat.c index 81e190d..99c5f31 100644 --- a/winboard/wchat.c +++ b/winboard/wchat.c @@ -3,7 +3,7 @@ * * Author: H.G.Muller (August 2009) * - * Copyright 2009, 2010 Free Software Foundation, Inc. + * Copyright 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. * * ------------------------------------------------------------------------ * @@ -62,6 +62,7 @@ extern HWND ChatDialog; extern HINSTANCE hInst; extern HWND hwndConsole; +extern char ics_handle[]; extern WindowPlacement wpChat[MAX_CHAT]; extern WindowPlacement wpConsole; @@ -180,7 +181,7 @@ LRESULT CALLBACK ChatProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam { static SnapData sd; char buf[MSG_SIZ], mess[MSG_SIZ]; - int partner = -1, i; + int partner = -1, i, x, y; static BOOL filterHasFocus[MAX_CHAT]; WORD wMask; HWND hMemo; @@ -189,21 +190,24 @@ LRESULT CALLBACK ChatProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam switch (message) { case WM_INITDIALOG: + Translate(hDlg, DLG_Chat); if(partner<0) { for(i=0; ipartner), chatPartner[i]); - } else EnableWindow( GetDlgItem(hDlg, IDC_Focus1+i-(i>partner)), 1 ); + } else EnableWindow( GetDlgItem(hDlg, IDC_Focus1+i-(i>partner)), 0 ); for(i=0; i is pressed while editing the filter, it's better to apply the filter rather than selecting the current game. @@ -284,16 +288,16 @@ LRESULT CALLBACK ChatProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam // from here on it could be back-end SaveInHistory(mess); if(!strcmp("whispers", chatPartner[partner])) - sprintf(buf, "whisper %s\n", mess); // WHISPER box uses "whisper" to send + snprintf(buf, MSG_SIZ, "whisper %s\n", mess); // WHISPER box uses "whisper" to send else if(!strcmp("shouts", chatPartner[partner])) - sprintf(buf, "shout %s\n", mess); // SHOUT box uses "shout" to send + snprintf(buf, MSG_SIZ, "shout %s\n", mess); // SHOUT box uses "shout" to send else { if(!atoi(chatPartner[partner])) { - sprintf(buf, "> %s\r\n", mess); // echo only tells to handle, not channel + snprintf(buf, MSG_SIZ, "> %s\r\n", mess); // echo only tells to handle, not channel InsertIntoMemo(hDlg, buf); - sprintf(buf, "xtell %s %s\n", chatPartner[partner], mess); + snprintf(buf, MSG_SIZ, "xtell %s %s\n", chatPartner[partner], mess); } else - sprintf(buf, "tell %s %s\n", chatPartner[partner], mess); + snprintf(buf, MSG_SIZ, "tell %s %s\n", chatPartner[partner], mess); } SendToICS(buf); break; @@ -357,12 +361,13 @@ void ChatPopUp(char *icsHandle) { FARPROC lpProc; int i, partner = -1; - + CheckMenuItem(GetMenu(hwndMain), IDM_NewChat, MF_CHECKED); for(i=0; i