From 7325ff43ccedc3a5d1877c81794498e010d51269 Mon Sep 17 00:00:00 2001 From: "ian%hixie.ch" Date: Mon, 1 Apr 2002 04:46:24 +0000 Subject: [PATCH] Changes Tinderbox to use either say or notify, configurable via the 'useNotice' variable. b=72960, r=timeless --- webtools/mozbot/BotModules/Tinderbox.bm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/webtools/mozbot/BotModules/Tinderbox.bm b/webtools/mozbot/BotModules/Tinderbox.bm index 8c7a90b5dc7..05cbbcdf649 100644 --- a/webtools/mozbot/BotModules/Tinderbox.bm +++ b/webtools/mozbot/BotModules/Tinderbox.bm @@ -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(@_); + } +}