From 2c2b2c2e4bef88a35a247f33f7b08fe90dc2a982 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Mon, 5 May 2014 05:18:59 +0000 Subject: [PATCH] Truncate all messages beyond MAX_NICK_MESSAGES --- PBot/AntiFlood.pm | 2 +- PBot/VERSION.pm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PBot/AntiFlood.pm b/PBot/AntiFlood.pm index 336ff4f9..fb518277 100644 --- a/PBot/AntiFlood.pm +++ b/PBot/AntiFlood.pm @@ -224,7 +224,7 @@ sub add_message { } # keep only MAX_NICK_MESSAGES message history per channel - if($length >= $self->{pbot}->{MAX_NICK_MESSAGES}) { + while($length >= $self->{pbot}->{MAX_NICK_MESSAGES}) { my %msg = %{ shift(@{ $self->message_history->{$account}->{channels}->{$channel}{messages} }) }; #$self->{pbot}->logger->log("shifting message off top: $msg{msg}, $msg{timestamp}\n"); $length--; diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 28daf378..2c8915c8 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,8 +13,8 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 564, - BUILD_DATE => "2014-05-01", + BUILD_REVISION => 565, + BUILD_DATE => "2014-05-04", }; 1;