You need to sign in or sign up before continuing.
Commit a79bcea6 authored by Dave Lawrence's avatar Dave Lawrence

Bug 856736 - Set X-Bugzilla-Type to dep_changed for 'dependency changed" bugmail

r/a=sgreen
parent e88503ba
...@@ -257,6 +257,7 @@ sub Send { ...@@ -257,6 +257,7 @@ sub Send {
$watching{$user_id} : undef, $watching{$user_id} : undef,
diffs => \@diffs, diffs => \@diffs,
rels_which_want => \%rels_which_want, rels_which_want => \%rels_which_want,
dep_only => $params->{dep_only}
}); });
push(@sent, $user->login) if $sent_mail; push(@sent, $user->login) if $sent_mail;
} }
...@@ -286,6 +287,7 @@ sub sendMail { ...@@ -286,6 +287,7 @@ sub sendMail {
my $watchingRef = $params->{watchers}; my $watchingRef = $params->{watchers};
my @diffs = @{ $params->{diffs} }; my @diffs = @{ $params->{diffs} };
my $relRef = $params->{rels_which_want}; my $relRef = $params->{rels_which_want};
my $dep_only = $params->{dep_only};
# Only display changes the user is allowed see. # Only display changes the user is allowed see.
my @display_diffs; my @display_diffs;
...@@ -332,6 +334,10 @@ sub sendMail { ...@@ -332,6 +334,10 @@ sub sendMail {
push(@changedfields, 'attachments.created'); push(@changedfields, 'attachments.created');
} }
my $bugmailtype = "changed";
$bugmailtype = "new" if !$bug->lastdiffed;
$bugmailtype = "dep_changed" if $dep_only;
my $vars = { my $vars = {
date => $date, date => $date,
to_user => $user, to_user => $user,
...@@ -345,6 +351,7 @@ sub sendMail { ...@@ -345,6 +351,7 @@ sub sendMail {
changedfields => \@changedfields, changedfields => \@changedfields,
new_comments => \@send_comments, new_comments => \@send_comments,
threadingmarker => build_thread_marker($bug->id, $user->id, !$bug->lastdiffed), threadingmarker => build_thread_marker($bug->id, $user->id, !$bug->lastdiffed),
bugmailtype => $bugmailtype
}; };
my $msg = _generate_bugmail($user, $vars); my $msg = _generate_bugmail($user, $vars);
MessageToMTA($msg); MessageToMTA($msg);
......
...@@ -16,7 +16,7 @@ To: [% to_user.email %] ...@@ -16,7 +16,7 @@ To: [% to_user.email %]
Subject: [[% terms.Bug %] [%+ bug.id %]] [% 'New: ' IF show_new %][%+ bug.short_desc %] Subject: [[% terms.Bug %] [%+ bug.id %]] [% 'New: ' IF show_new %][%+ bug.short_desc %]
Date: [% date %] Date: [% date %]
X-Bugzilla-Reason: [% reasonsheader %] X-Bugzilla-Reason: [% reasonsheader %]
X-Bugzilla-Type: [% isnew ? 'new' : 'changed' %] X-Bugzilla-Type: [% bugmailtype %]
X-Bugzilla-Watch-Reason: [% reasonswatchheader %] X-Bugzilla-Watch-Reason: [% reasonswatchheader %]
[%+ INCLUDE "email/header-common.txt.tmpl" %] [%+ INCLUDE "email/header-common.txt.tmpl" %]
X-Bugzilla-Changed-Fields: [% changedfields.join(" ") %] X-Bugzilla-Changed-Fields: [% changedfields.join(" ") %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment