Bug 292424 - [RDF] Asking for the entire RSS feed can easily fill mozbot's queue. Patch by Max Kanat-Alexander <mkanat@bugzilla.org>, r=Hixie,Wolf

git-svn-id: svn://10.0.0.236/trunk@254954 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
psychoticwolf%carolina.rr.com 2008-11-07 16:42:25 +00:00
parent 49464efd3b
commit 91da6efee4

View File

@ -20,6 +20,7 @@ sub RegisterConfig {
['updateDelay', 1, 1, 600],
['preferredLineLength', 1, 1, 80],
['maxInChannel', 1, 1, 5],
['maxLines', 1, 1, 20],
['trimTitles', 1, 1, '0'],
['data', 0, 0, {}], # data -> uri -> (title, link, last, items -> uri)
['mutes', 1, 1, {}], # uri -> "channel channel channel"
@ -251,6 +252,12 @@ sub ReportAll {
"Items in $self->{'data'}->{$uri}->{'title'} - $self->{'data'}->{$uri}->{'link'}: ",
"$event->{'from'}: ", ' -- ', @output);
if (@output > $self->{'maxLines'}) {
splice(@output, $self->{'maxLines'} + 1);
unshift(@output, "The list is longer than $self->{'maxLines'}"
. " lines, only the first $self->{'maxLines'} will be shown.");
}
if (@output > $self->{'maxInChannel'}) {
foreach (@output) {
$self->directSay($event, $_);