From e480b9b16579a0434dba61c58dec362511062cb8 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sun, 31 May 2015 15:30:21 +0200 Subject: 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). --- src/irc/core/irc-servers.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/irc') diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index c04c4318..31ba397b 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -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; } -- cgit v1.2.3