From 40c13a54e442173b160e66288c97808d04f232d7 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Thu, 12 Oct 2017 15:04:30 +1300 Subject: Keep latest message buffer rolling --- plugin/antiflood.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugin') diff --git a/plugin/antiflood.pm b/plugin/antiflood.pm index d9326ba..a4fe09c 100644 --- a/plugin/antiflood.pm +++ b/plugin/antiflood.pm @@ -27,8 +27,8 @@ sub message { my $now = time(); push @{$lastmsg{$nick}}, $now; - # FIXME limit buffer size to 5 if (@{$lastmsg{$nick}} >= $message_count) { + @{$lastmsg{$nick}} = splice @{$lastmsg{$nick}}, 1, $message_count - 1; my $first = @{$lastmsg{$nick}}[0]; if ($now - $first <= $message_period) { $irc->yield(kick => $channel => $nick => "Flood"); -- cgit v1.1