1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-01 04:14:16 -04:00

Improve ischannel_func (#253)

The function now skips all the leading characters that are in the STATUSMSG. If
the server didn't send the STATUSMSG option then it's assumed to be "@+" for
compatibility with bahamut 2.4 (sic).
This commit is contained in:
LemonBoy 2015-05-31 15:30:21 +02:00
parent 16c71cf1fb
commit e480b9b165

View File

@ -72,17 +72,17 @@ static int isnickflag_func(SERVER_REC *server, char flag)
static int ischannel_func(SERVER_REC *server, const char *data)
{
IRC_SERVER_REC *irc_server = (IRC_SERVER_REC *) server;
char *chantypes;
char *chantypes, *statusmsg;
chantypes = g_hash_table_lookup(irc_server->isupport, "chantypes");
if (chantypes == NULL)
chantypes = "#&!+"; /* normal, local, secure, modeless */
statusmsg = g_hash_table_lookup(irc_server->isupport, "statusmsg");
if (statusmsg == NULL)
statusmsg = "@+";
/* @#channel, @+#channel */
if (data[0] == '@' && data[1] == '+')
data += 2;
else if (data[0] == '@')
data += 1;
while (strchr(statusmsg, *data) != NULL)
data++;
return strchr(chantypes, *data) != NULL;
}