mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 20:33:46 +02:00
Merge pull request #248 from LemonBoy/chantypes
Implement CHANTYPES support
This commit is contained in:
commit
7b46dae182
25 changed files with 122 additions and 91 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue