From 4f4c1fa7946fe9408c25494a8b5622f68fd1725b Mon Sep 17 00:00:00 2001 From: "bzrmirror%bugzilla.org" Date: Tue, 13 Aug 2013 18:16:38 +0000 Subject: [PATCH] Bug 856736 - Set X-Bugzilla-Type to dep_changed for 'dependency changed" bugmail r/a=sgreen git-svn-id: svn://10.0.0.236/trunk@264933 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/Bugzilla/BugMail.pm | 15 +++++++++++---- .../en/default/email/bugmail-header.txt.tmpl | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 8b6c48ccce6..c960635304a 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -8675 \ No newline at end of file +8676 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm b/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm index ee25613b755..1169e94a7b0 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm +++ b/mozilla/webtools/bugzilla/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); diff --git a/mozilla/webtools/bugzilla/template/en/default/email/bugmail-header.txt.tmpl b/mozilla/webtools/bugzilla/template/en/default/email/bugmail-header.txt.tmpl index f9cdbd814a0..286c70bcd8b 100644 --- a/mozilla/webtools/bugzilla/template/en/default/email/bugmail-header.txt.tmpl +++ b/mozilla/webtools/bugzilla/template/en/default/email/bugmail-header.txt.tmpl @@ -16,7 +16,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(" ") %]