From 47fd84c5bc3306b946c253afda633d7cbc61a8a6 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 14 Jun 2000 17:52:03 +0000 Subject: Fixed some flood detection, ignoring and autoignoring bugs. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@339 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/flood/flood.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/irc/flood/flood.c') diff --git a/src/irc/flood/flood.c b/src/irc/flood/flood.c index 0466d769..b1096359 100644 --- a/src/irc/flood/flood.c +++ b/src/irc/flood/flood.c @@ -167,6 +167,7 @@ static void flood_newmsg(IRC_SERVER_REC *server, int level, const char *nick, co if (rec != NULL) { if (++rec->msgcount > flood_max_msgs) { /* flooding! */ + rec->first = 0; signal_emit("flood", 5, server, nick, host, GINT_TO_POINTER(rec->level), target); } return; @@ -242,22 +243,16 @@ static void flood_ctcp(const char *data, IRC_SERVER_REC *server, const char *nic static void read_settings(void) { - int time; - flood_timecheck = settings_get_int("flood_timecheck"); flood_max_msgs = settings_get_int("flood_max_msgs"); - time = flood_timecheck > 500 ? 500 : - (flood_timecheck > 0 && flood_timecheck < 100) ? 100 : - flood_timecheck; - if (flood_tag != -1) { g_source_remove(flood_tag); flood_tag = -1; } if (time > 0 && flood_max_msgs > 0) { - flood_tag = g_timeout_add(time, (GSourceFunc) flood_timeout, NULL); + flood_tag = g_timeout_add(500, (GSourceFunc) flood_timeout, NULL); signal_add("event privmsg", (SIGNAL_FUNC) flood_privmsg); signal_add("event notice", (SIGNAL_FUNC) flood_notice); signal_add("ctcp msg", (SIGNAL_FUNC) flood_ctcp); @@ -267,8 +262,8 @@ static void read_settings(void) void irc_flood_init(void) { - settings_add_int("flood", "flood_timecheck", 8000); - settings_add_int("flood", "flood_max_msgs", 5); + settings_add_int("flood", "flood_timecheck", 8); + settings_add_int("flood", "flood_max_msgs", 4); flood_tag = -1; read_settings(); -- cgit v1.2.3