{\r
FARPROC lpProc;\r
int i, partner = -1;\r
+ char buf[MSG_SIZ];\r
+ static int first = 1;\r
\r
CheckMenuItem(GetMenu(hwndMain), IDM_NewChat, MF_CHECKED);\r
for(i=0; i<MAX_CHAT; i++) if(chatHandle[i] == NULL) { partner = i; break; }\r
if(partner == -1) { DisplayError("You first have to close a Chat Box\nbefore you can open a new one", 0); return; }\r
- if(icsHandle) // [HGM] clickbox set handle in advance\r
+ if(icsHandle) { // [HGM] clickbox set handle in advance\r
safeStrCpy(chatPartner[partner], icsHandle,\r
sizeof(chatPartner[partner])/sizeof(chatPartner[partner][0]) );\r
- else chatPartner[partner][0] = NULLCHAR;\r
+ if(sscanf(icsHandle, "%d", &i) == 1) { // make sure channel is on\r
+ snprintf(buf, MSG_SIZ, "addlist ch %d\n", i);\r
+ SendToICS(buf);\r
+ if(first) first=0, SendToICS(buf); // work-around for weirdness: On public FICS code first attempt on login is completely ignored\r
+ }\r
+ } else chatPartner[partner][0] = NULLCHAR;\r
chatCount++;\r
\r
lpProc = MakeProcInstance( (FARPROC) ChatProc, hInst );\r