mirror of
https://github.com/pragma-/pbot.git
synced 2025-03-01 12:00:45 +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
|
# 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} }) };
|
my %msg = %{ shift(@{ $self->message_history->{$account}->{channels}->{$channel}{messages} }) };
|
||||||
#$self->{pbot}->logger->log("shifting message off top: $msg{msg}, $msg{timestamp}\n");
|
#$self->{pbot}->logger->log("shifting message off top: $msg{msg}, $msg{timestamp}\n");
|
||||||
$length--;
|
$length--;
|
||||||
|
@ -13,8 +13,8 @@ use warnings;
|
|||||||
# These are set automatically by the build/commit script
|
# These are set automatically by the build/commit script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 564,
|
BUILD_REVISION => 565,
|
||||||
BUILD_DATE => "2014-05-01",
|
BUILD_DATE => "2014-05-04",
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user