diff options
author | Jilles Tjoelker <jilles@irssi.org> | 2007-10-12 15:09:12 +0000 |
---|---|---|
committer | jilles <jilles@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2007-10-12 15:09:12 +0000 |
commit | b0b26b6e777298e34b30c227b70455b30298d03b (patch) | |
tree | 9c930c960358045e0fc57aabd40e6e2846504879 /src | |
parent | 5d7a264587dd4e42c21a45821e76b34a0f94d8af (diff) | |
download | irssi-b0b26b6e777298e34b30c227b70455b30298d03b.zip |
Get -kicks and -msgs from TARGMAX and MAXTARGETS 005 tokens.
We do not do this for WHOIS because the resulting replies
tend to be buggy and inconsistent.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4617 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/irc/core/irc-servers.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index 21534f52..89bc59de 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -807,6 +807,32 @@ void irc_server_init_isupport(IRC_SERVER_REC *server) else server->nick_comp_func = irc_nickcmp_ascii; } + + if ((sptr = g_hash_table_lookup(server->isupport, "TARGMAX"))) { + char *p = sptr; + server->max_kicks_in_cmd = 1; + server->max_msgs_in_cmd = 1; + /* Not doing WHOIS here until it is clear what it means. */ + while (*p != '\0') { + if (!strncasecmp(p, "KICK:", 5)) { + server->max_kicks_in_cmd = atoi(p + 5); + if (server->max_kicks_in_cmd <= 0) + server->max_kicks_in_cmd = 30; + } else if (!strncasecmp(p, "PRIVMSG:", 8)) { + server->max_msgs_in_cmd = atoi(p + 8); + if (server->max_msgs_in_cmd <= 0) + server->max_msgs_in_cmd = 30; + } + p = strchr(p, ','); + if (p == NULL) + break; + p++; + } + } else if ((sptr = g_hash_table_lookup(server->isupport, "MAXTARGETS"))) { + server->max_msgs_in_cmd = atoi(sptr); + if (server->max_msgs_in_cmd <= 0) + server->max_msgs_in_cmd = 1; + } } void irc_servers_init(void) |