From e76afb528d2e56f1b228249b1b8def2cdd9c9230 Mon Sep 17 00:00:00 2001 From: Wouter Coekaerts Date: Thu, 18 May 2006 12:33:07 +0000 Subject: [PATCH] Fix whois_hide_safe_channel_id: only look at the beginning of a channel name, not in the middle git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4268 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/irc/fe-whois.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/fe-common/irc/fe-whois.c b/src/fe-common/irc/fe-whois.c index bd18f5bd..3f738ab6 100644 --- a/src/fe-common/irc/fe-whois.c +++ b/src/fe-common/irc/fe-whois.c @@ -202,9 +202,9 @@ static void event_whois_usermode(IRC_SERVER_REC *server, const char *data) static void hide_safe_channel_id(IRC_SERVER_REC *server, char *chans) { - const char *idchan; + const char *idchan, *nick_flags; char *p, *dest, *end, id; - int count, length; + int count, length, chanstart; if (!server->isupport_sent) idchan = "!:5"; @@ -213,6 +213,7 @@ static void hide_safe_channel_id(IRC_SERVER_REC *server, char *chans) if (idchan == NULL) return; } + nick_flags = server->get_nick_flags(server); while (*idchan != '\0') { id = *idchan; @@ -227,12 +228,18 @@ static void hide_safe_channel_id(IRC_SERVER_REC *server, char *chans) idchan = end; count = 0; + chanstart = TRUE; for (dest = p = chans; *p != '\0'; p++) { if (count > 0) count--; else { - if (*p == id) - count = length; + if (*p == ' ') + chanstart = TRUE; + else { + if (chanstart && *p == id) + count = length; + chanstart = chanstart && strchr(nick_flags, *p); + } *dest++ = *p; } }