From becc619fe5f9413393ee1b21951687323a6e32e4 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 10 Feb 2010 10:55:51 +0100 Subject: [PATCH] Allow WB Chat Box to be dedicated to shouts and 'it' By putting 'shouts' in the handle field, a chat window will capture all shouts and c-shouts, and send messages typed into it as shouts. The bracketing of the shouter name now indicates the type of shout. The handle for WHISPER Chat Boxes has been changed to 'whispers', to make it easier to pop them up by clicking the console. --- backend.c | 14 +++++++++++++- winboard/wchat.c | 4 +++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/backend.c b/backend.c index c33c164..206676d 100644 --- a/backend.c +++ b/backend.c @@ -2740,6 +2740,9 @@ read_from_ics(isr, closure, data, count, error) channel = -1; if(started == STARTED_NONE && (looking_at(buf, &i, "* tells you:") || looking_at(buf, &i, "* says:") || looking_at(buf, &i, "* whispers:") || + looking_at(buf, &i, "* shouts:") || + looking_at(buf, &i, "* c-shouts:") || + looking_at(buf, &i, "--> * ") || looking_at(buf, &i, "*(*):") && (sscanf(star_match[1], "%d", &channel),1) || looking_at(buf, &i, "*(*)(*):") && (sscanf(star_match[2], "%d", &channel),1) || looking_at(buf, &i, "*(*)(*)(*):") && (sscanf(star_match[3], "%d", &channel),1) || @@ -2757,10 +2760,19 @@ read_from_ics(isr, closure, data, count, error) } else if(buf[i-3] == 'r') // whisper; look if there is a WHISPER chatbox for(p=0; p') // shout, c-shout or it; look if there is a 'shouts' chatbox + for(p=0; p') { talker[0] = '<'; strcat(talker, "> "); } + else if(buf[i-8] == '-') { talker[0] = '('; strcat(talker, ") "); } + else { talker[0] = '['; strcat(talker, "] "); } + chattingPartner = p; break; + } } if(chattingPartner<0) // if not, look if there is a chatbox for this indivdual for(p=0; p %s\r\n", mess); // echo only tells to handle, not channel -- 1.7.0.4