Changes Tinderbox to use either say or notify, configurable via the 'useNotice' variable. b=72960, r=timeless

This commit is contained in:
ian%hixie.ch 2002-04-01 04:46:24 +00:00
Родитель 9981c0a415
Коммит 7325ff43cc
1 изменённых файлов: 13 добавлений и 3 удалений

Просмотреть файл

@ -21,6 +21,7 @@ sub RegisterConfig {
['lasttreesStates', 0, 0, []], # copy of trees in last test
['tinderboxStates', 0, 0, {}], # ->tree->build->(current, previous, lastupdate)
['updateDelay', 1, 1, 120],
['useNotice', 1, 1, 1], # set to 1 to use notice and 0 to use a normal message
['_lastupdate', 0, 0, 0],
['preferredLineLength', 1, 1, 100],
['mutes', 1, 1, {}], # tree -> "channel channel channel"
@ -261,14 +262,14 @@ sub CheckForUpdates {
unless ($mutedChannels{$_}) {
local $event->{'target'} = $_;
foreach (@changes) {
$self->say($event, $_);
$self->sayOrNotice($event, $_);
}
if (@output < 3) {
foreach (@output) {
$self->say($event, $_);
$self->sayOrNotice($event, $_);
}
} else {
$self->say($event, "Many tree changes just occured. Check tinderbox to see what they were.");
$self->sayOrNotice($event, "Many tree changes just occured. Check tinderbox to see what they were.");
}
}
}
@ -470,3 +471,12 @@ sub Report {
}
}
}
sub sayOrNotice {
my $self = shift;
if ($self->{'useNotice'}) {
$self->notice(@_);
} else {
$self->say(@_);
}
}