1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-20 05:13:37 -04:00

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
This commit is contained in:
Wouter Coekaerts 2006-05-18 12:33:07 +00:00 committed by coekie
parent b1effeb58e
commit e76afb528d

View File

@ -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) 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; char *p, *dest, *end, id;
int count, length; int count, length, chanstart;
if (!server->isupport_sent) if (!server->isupport_sent)
idchan = "!:5"; idchan = "!:5";
@ -213,6 +213,7 @@ static void hide_safe_channel_id(IRC_SERVER_REC *server, char *chans)
if (idchan == NULL) if (idchan == NULL)
return; return;
} }
nick_flags = server->get_nick_flags(server);
while (*idchan != '\0') { while (*idchan != '\0') {
id = *idchan; id = *idchan;
@ -227,12 +228,18 @@ static void hide_safe_channel_id(IRC_SERVER_REC *server, char *chans)
idchan = end; idchan = end;
count = 0; count = 0;
chanstart = TRUE;
for (dest = p = chans; *p != '\0'; p++) { for (dest = p = chans; *p != '\0'; p++) {
if (count > 0) if (count > 0)
count--; count--;
else { else {
if (*p == id) if (*p == ' ')
chanstart = TRUE;
else {
if (chanstart && *p == id)
count = length; count = length;
chanstart = chanstart && strchr(nick_flags, *p);
}
*dest++ = *p; *dest++ = *p;
} }
} }