From b0b26b6e777298e34b30c227b70455b30298d03b Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Fri, 12 Oct 2007 15:09:12 +0000 Subject: [PATCH] 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 --- src/irc/core/irc-servers.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) 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)