summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-07-30 19:22:06 +0200
committerDave Lawrence <dlawrence@mozilla.com>2013-07-30 19:22:06 +0200
commit6fbae131d57590e48e5a5ad0b9362767ce3bdf9f (patch)
treec68317f2111b1de15f89f06be8b78dfaba523dcb
parent249517dcd0d8e2fe584d85abd91ede580e2c9d0d (diff)
downloadbugzilla-6fbae131d57590e48e5a5ad0b9362767ce3bdf9f.tar.gz
bugzilla-6fbae131d57590e48e5a5ad0b9362767ce3bdf9f.tar.xz
Bug 899627 - backport upstream bug 856736 to bmo/4.2 for filtering on dependency bugmail
-rw-r--r--Bugzilla/BugMail.pm9
-rw-r--r--template/en/default/email/bugmail-header.txt.tmpl2
2 files changed, 9 insertions, 2 deletions
diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm
index 6e7fc7b80..3d3bd2dbf 100644
--- a/Bugzilla/BugMail.pm
+++ b/Bugzilla/BugMail.pm
@@ -332,6 +332,7 @@ sub Send {
diffs => \@diffs,
rels_which_want => \%rels_which_want,
referenced_bugs => $referenced_bugs,
+ dep_only => $params->{dep_only}
});
push(@sent, $user->login) if $sent_mail;
}
@@ -352,7 +353,7 @@ sub Send {
sub sendMail {
my $params = shift;
-
+
my $user = $params->{to};
my $bug = $params->{bug};
my @send_comments = @{ $params->{comments} };
@@ -362,6 +363,7 @@ sub sendMail {
my @diffs = @{ $params->{diffs} };
my $relRef = $params->{rels_which_want};
my $referenced_bugs = $params->{referenced_bugs};
+ my $dep_only = $params->{dep_only};
# Only display changes the user is allowed see.
my @display_diffs;
@@ -411,6 +413,10 @@ sub sendMail {
push(@changedfieldnames, 'attachment.created');
}
+ my $bugmailtype = "changed";
+ $bugmailtype = "new" if !$bug->lastdiffed;
+ $bugmailtype = "dep_changed" if $dep_only;
+
my $vars = {
date => $date,
to_user => $user,
@@ -426,6 +432,7 @@ sub sendMail {
new_comments => \@send_comments,
threadingmarker => build_thread_marker($bug->id, $user->id, !$bug->lastdiffed),
referenced_bugs => $referenced_bugs,
+ bugmailtype => $bugmailtype
};
my $msg = _generate_bugmail($user, $vars);
MessageToMTA($msg);
diff --git a/template/en/default/email/bugmail-header.txt.tmpl b/template/en/default/email/bugmail-header.txt.tmpl
index 7e871c4f8..679e705cd 100644
--- a/template/en/default/email/bugmail-header.txt.tmpl
+++ b/template/en/default/email/bugmail-header.txt.tmpl
@@ -31,7 +31,7 @@ To: [% to_user.email %]
Subject: [[% terms.Bug %] [%+ bug.id %]] [% 'New: ' IF show_new %][%+ bug.short_desc %]
Date: [% date %]
X-Bugzilla-Reason: [% reasonsheader %]
-X-Bugzilla-Type: [% isnew ? 'new' : 'changed' %]
+X-Bugzilla-Type: [% bugmailtype %]
X-Bugzilla-Watch-Reason: [% reasonswatchheader %]
[%+ INCLUDE "email/header-common.txt.tmpl" %]
X-Bugzilla-Changed-Fields: [% changedfields.join(" ") %]