summaryrefslogtreecommitdiff
path: root/src/fe-common/irc
diff options
context:
space:
mode:
authorWouter Coekaerts <coekie@irssi.org>2006-05-18 12:33:07 +0000
committercoekie <coekie@dbcabf3a-b0e7-0310-adc4-f8d773084564>2006-05-18 12:33:07 +0000
commite76afb528d2e56f1b228249b1b8def2cdd9c9230 (patch)
treeff807662b772b0b94544fb6c1690e955bc2d4ba0 /src/fe-common/irc
parentb1effeb58e0ec0bad16b82d98013c996291700dc (diff)
downloadirssi-e76afb528d2e56f1b228249b1b8def2cdd9c9230.zip
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
Diffstat (limited to 'src/fe-common/irc')
-rw-r--r--src/fe-common/irc/fe-whois.c15
1 files 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;
}
}