mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-27 06:19:25 +01:00
Truncate all messages beyond MAX_NICK_MESSAGES
This commit is contained in:
parent
af447c2614
commit
2c2b2c2e4b
@ -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--;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user