diff options
| author | David Phillips <david@sighup.nz> | 2017-10-12 15:04:30 +1300 | 
|---|---|---|
| committer | David Phillips <david@sighup.nz> | 2017-10-12 15:04:30 +1300 | 
| commit | 40c13a54e442173b160e66288c97808d04f232d7 (patch) | |
| tree | 1000a9ae532fc541b5855dfb731cf827fc5a8ee8 /plugin | |
| parent | 8714b27669ec7032a31ef88a8c8c451bcee56552 (diff) | |
| download | idalius-40c13a54e442173b160e66288c97808d04f232d7.tar.xz | |
Keep latest message buffer rolling
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/antiflood.pm | 2 | 
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");  | 
