From 2fdfa60f167cbbee507351fba19c8e01880d9ae6 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Wed, 25 Jan 2012 14:47:08 -0500 Subject: Bug 719526 - Add an extra mail header to messages containing a link to a first patch r=glob --- Bugzilla/BugMail.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Bugzilla/BugMail.pm') diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index 60ff45e38..efbba5215 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -130,7 +130,7 @@ sub Send { my $comments = $bug->comments({ after => $start, to => $end }); # Skip empty comments. @$comments = grep { $_->type || $_->body =~ /\S/ } @$comments; - + ########################################################################### # Start of email filtering code ########################################################################### @@ -361,6 +361,14 @@ sub sendMail { push(@watchingrel, 'None') unless @watchingrel; push @watchingrel, map { user_id_to_login($_) } @$watchingRef; + my @changedfields = uniq map { $_->{field_name} } @display_diffs; + + # Add Attachment Created to changedfields if one or more + # comments contain information about a new attachment + if (grep($_->type == CMT_ATTACHMENT_CREATED, @send_comments)) { + push(@changedfields, 'Attachment Created'); + } + my $vars = { date => $date, to_user => $user, @@ -371,7 +379,7 @@ sub sendMail { reasonswatchheader => join(" ", @watchingrel), changer => $changer, diffs => \@display_diffs, - changedfields => [uniq map { $_->{field_name} } @display_diffs], + changedfields => \@changedfields, new_comments => \@send_comments, threadingmarker => build_thread_marker($bug->id, $user->id, !$bug->lastdiffed), }; -- cgit v1.2.3-24-g4f1b