summaryrefslogtreecommitdiffstats
path: root/Bugzilla/BugMail.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-02-17 00:34:16 +0100
committerDave Lawrence <dlawrence@mozilla.com>2012-02-17 00:34:16 +0100
commit8cf999925d27402a3c2a9abc4394d33b3f11c97a (patch)
tree51eec2623af4f3872019c49ceac4b38e92ac5fb0 /Bugzilla/BugMail.pm
parentbdbd195a77ffae05f24884e7f445d34afce48f15 (diff)
downloadbugzilla-8cf999925d27402a3c2a9abc4394d33b3f11c97a.tar.gz
bugzilla-8cf999925d27402a3c2a9abc4394d33b3f11c97a.tar.xz
Bug 721161 - Add to X-Bugzilla-Changed-Fields when a new attachment is created on a bug
r/a=LpSolit
Diffstat (limited to 'Bugzilla/BugMail.pm')
-rw-r--r--Bugzilla/BugMail.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm
index e26c5e100..764b223db 100644
--- a/Bugzilla/BugMail.pm
+++ b/Bugzilla/BugMail.pm
@@ -326,6 +326,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 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 $vars = {
date => $date,
to_user => $user,
@@ -336,7 +344,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),
};