summaryrefslogtreecommitdiffstats
path: root/checksetup.pl
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-11-01 08:09:28 +0100
committerlpsolit%gmail.com <>2005-11-01 08:09:28 +0100
commit967d3f6601d528cb2499f88d12acba0ce61ecfa2 (patch)
tree931601cb1a6a47f065f7a1760e27d94683cf50a0 /checksetup.pl
parent7cb75c8af8b5cdcbc1040e659a4d6d2d8457d7e7 (diff)
downloadbugzilla-967d3f6601d528cb2499f88d12acba0ce61ecfa2.tar.gz
bugzilla-967d3f6601d528cb2499f88d12acba0ce61ecfa2.tar.xz
Bug 314269: Add email pref to not send mail about dependency changes - Patch by Todd Stansell <tjs@tellme.com> r=joel a=justdave
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-xchecksetup.pl20
1 files changed, 20 insertions, 0 deletions
diff --git a/checksetup.pl b/checksetup.pl
index c728c4636..84c94f108 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -3890,6 +3890,26 @@ if ($dbh->bz_column_info("profiles", "emailflags")) {
$dbh->bz_drop_column("profiles", "emailflags");
}
+# Check for any "new" email settings that wouldn't have been ported over
+# during the block above. Since these settings would have otherwise
+# fallen under EVT_OTHER, we'll just clone those settings. That way if
+# folks have already disabled all of that mail, there won't be any change.
+{
+ my %events = ("Dependency Tree Changes" => EVT_DEPEND_BLOCK);
+
+ foreach my $desc (keys %events) {
+ my $event = $events{$desc};
+ $sth = $dbh->prepare("SELECT count(*) FROM email_setting WHERE event = $event");
+ $sth->execute();
+ if (!($sth->fetchrow_arrayref()->[0])) {
+ # No settings in the table yet, so we assume that this is the
+ # first time it's being set.
+ print "Initializing \"$desc\" email_setting ...\n" unless $silent;
+ CloneEmailEvent(EVT_OTHER, $event);
+ }
+ }
+}
+
sub CloneEmailEvent {
my ($source, $target) = @_;