Merge pull request #248 from LemonBoy/chantypes

Implement CHANTYPES support
This commit is contained in:
Alexander Færøy 2015-09-10 01:37:08 +02:00
commit 7b46dae182
25 changed files with 122 additions and 91 deletions

View file

@ -72,13 +72,20 @@ static int isnickflag_func(SERVER_REC *server, char flag)
static int ischannel_func(SERVER_REC *server, const char *data)
{
if (*data == '@') {
/* @#channel, @+#channel */
IRC_SERVER_REC *irc_server = (IRC_SERVER_REC *) server;
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 = "@+";
while (strchr(statusmsg, *data) != NULL)
data++;
if (*data == '+' && ischannel(data[1]))
return 1;
}
return ischannel(*data);
return strchr(chantypes, *data) != NULL;
}
static char **split_line(const SERVER_REC *server, const char *line,