From: H.G. Muller Date: Thu, 6 Feb 2014 17:36:41 +0000 (+0100) Subject: Also display channel tell in ICS Console during private chat X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=f94596a352d0d54c8214ddf2cbc98bdc7eace640 Also display channel tell in ICS Console during private chat Channel tells of players for which a chat wa opened were displayed in that chat, as well as in the channel chatbox, if the latter was open. But when there was no channel chatbox it would not appear as colorized channel tell in the console. This is now fixed, and in the private chat box such a message is indicated as 'broadcast'. --- diff --git a/backend.c b/backend.c index b95ff6a..9c2711f 100644 --- a/backend.c +++ b/backend.c @@ -3072,7 +3072,7 @@ read_from_ics (InputSourceRef isr, VOIDSTAR closure, char *data, int count, int char mess[MSG_SIZ]; snprintf(mess, MSG_SIZ, "%s%s", talker, parse); OutputChatMessage(chattingPartner, mess); - if(collective) { // broadcasted talk also goes to private chatbox of talker + if(collective == 1) { // broadcasted talk also goes to private chatbox of talker int p; talker[strlen(talker+1)-1] = NULLCHAR; // strip closing delimiter for(p=0; p= 0) // channel broadcast; look if there is a chatbox for this channel for(p=0; p= '0' && chatPartner[p][0] <= '9' && channel == atoi(chatPartner[p])) { talker[0] = '['; strcat(talker, "] "); - Colorize(channel == 1 ? ColorChannel1 : ColorChannel, FALSE); - collective = 1; + Colorize((channel == 1 ? ColorChannel1 : ColorChannel), FALSE); chattingPartner = p; break; } } else if(buf[i-3] == 'e') // kibitz; look if there is a KIBITZ chatbox for(p=0; p') {// shout, c-shout or it; look if there is a 'shouts' chatbox if(buf[i-8] == '-' && buf[i-3] == 't') for(p=0; p') { talker[0] = '<'; strcat(talker, "> "); Colorize(ColorShout, FALSE); } else if(buf[i-8] == '-') { talker[0] = '('; strcat(talker, ") "); Colorize(ColorSShout, FALSE); } else { talker[0] = '['; strcat(talker, "] "); Colorize(ColorShout, FALSE); } - collective = 1; chattingPartner = p; break; } } } if(chattingPartner<0) // if not, look if there is a chatbox for this indivdual for(p=0; p 0 && buf[oldi-1] == '\n') oldi--; - if (oldi > next_out) SendToPlayer(&buf[next_out], oldi - next_out); started = STARTED_COMMENT; parse_pos = 0; parse[0] = NULLCHAR; savingComment = 3 + chattingPartner; // counts as TRUE - suppressKibitz = TRUE; - continue; + if(collective == 3) i = oldi; else { + suppressKibitz = TRUE; + if(oldi > 0 && buf[oldi-1] == '\n') oldi--; + if (oldi > next_out) SendToPlayer(&buf[next_out], oldi - next_out); + continue; + } } } // [HGM] chat: end of patch @@ -3442,7 +3448,7 @@ read_from_ics (InputSourceRef isr, VOIDSTAR closure, char *data, int count, int parse[parse_pos] = NULLCHAR; started = STARTED_COMMENT; savingComment = TRUE; - } else { + } else if(collective != 3) { started = STARTED_CHATTER; savingComment = FALSE; }