aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugin/antiflood.pm2
1 files changed, 1 insertions, 1 deletions
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");