summaryrefslogtreecommitdiffstats
path: root/Bugzilla/BugMail.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-07-30 18:31:24 +0200
committerDave Lawrence <dlawrence@mozilla.com>2013-07-30 18:31:24 +0200
commita79bcea69238858ae4c77ece81e577db4069eee2 (patch)
treecb1cdfef14ebcb7787c4cbc6679bddd5e7ec5faf /Bugzilla/BugMail.pm
parente88503ba4f068a4392dba33ca210ed82a64c20e9 (diff)
downloadbugzilla-a79bcea69238858ae4c77ece81e577db4069eee2.tar.gz
bugzilla-a79bcea69238858ae4c77ece81e577db4069eee2.tar.xz
Bug 856736 - Set X-Bugzilla-Type to dep_changed for 'dependency changed" bugmail
r/a=sgreen
Diffstat (limited to 'Bugzilla/BugMail.pm')
-rw-r--r--Bugzilla/BugMail.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm
index ee25613b7..1169e94a7 100644
--- a/Bugzilla/BugMail.pm
+++ b/Bugzilla/BugMail.pm
@@ -257,6 +257,7 @@ sub Send {
$watching{$user_id} : undef,
diffs => \@diffs,
rels_which_want => \%rels_which_want,
+ dep_only => $params->{dep_only}
});
push(@sent, $user->login) if $sent_mail;
}
@@ -277,7 +278,7 @@ sub Send {
sub sendMail {
my $params = shift;
-
+
my $user = $params->{to};
my $bug = $params->{bug};
my @send_comments = @{ $params->{comments} };
@@ -286,13 +287,14 @@ sub sendMail {
my $watchingRef = $params->{watchers};
my @diffs = @{ $params->{diffs} };
my $relRef = $params->{rels_which_want};
+ my $dep_only = $params->{dep_only};
# Only display changes the user is allowed see.
my @display_diffs;
foreach my $diff (@diffs) {
my $add_diff = 0;
-
+
if (grep { $_ eq $diff->{field_name} } TIMETRACKING_FIELDS) {
$add_diff = 1 if $user->is_timetracker;
}
@@ -325,13 +327,17 @@ sub sendMail {
push @watchingrel, map { user_id_to_login($_) } @$watchingRef;
my @changedfields = uniq map { $_->{field_name} } @display_diffs;
-
+
# Add attachments.created to changedfields if one or more
# comments contain information about a new attachment
if (grep($_->type == CMT_ATTACHMENT_CREATED, @send_comments)) {
push(@changedfields, 'attachments.created');
}
+ my $bugmailtype = "changed";
+ $bugmailtype = "new" if !$bug->lastdiffed;
+ $bugmailtype = "dep_changed" if $dep_only;
+
my $vars = {
date => $date,
to_user => $user,
@@ -342,9 +348,10 @@ sub sendMail {
reasonswatchheader => join(" ", @watchingrel),
changer => $changer,
diffs => \@display_diffs,
- changedfields => \@changedfields,
+ changedfields => \@changedfields,
new_comments => \@send_comments,
threadingmarker => build_thread_marker($bug->id, $user->id, !$bug->lastdiffed),
+ bugmailtype => $bugmailtype
};
my $msg = _generate_bugmail($user, $vars);
MessageToMTA($msg);