diff options
author | LemonBoy <thatlemon@gmail.com> | 2015-05-31 15:30:21 +0200 |
---|---|---|
committer | LemonBoy <thatlemon@gmail.com> | 2015-05-31 15:30:21 +0200 |
commit | e480b9b16579a0434dba61c58dec362511062cb8 (patch) | |
tree | 514ffa0ec205bf46706221f7b181767c4cfbcd26 /src/irc/core | |
parent | 16c71cf1fbc1e7987fdde821813005b87237e951 (diff) | |
download | irssi-e480b9b16579a0434dba61c58dec362511062cb8.zip |
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).
Diffstat (limited to 'src/irc/core')
-rw-r--r-- | src/irc/core/irc-servers.c | 12 |
1 files changed, 6 insertions, 6 deletions
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; } |