]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 721161 - Add to X-Bugzilla-Changed-Fields when a new attachment is created on...
authorDave Lawrence <dlawrence@mozilla.com>
Thu, 16 Feb 2012 23:34:16 +0000 (18:34 -0500)
committerDave Lawrence <dlawrence@mozilla.com>
Thu, 16 Feb 2012 23:34:16 +0000 (18:34 -0500)
r/a=LpSolit

Bugzilla/BugMail.pm

index e26c5e100d949ff1efc62f2eadcdedb04f18098b..764b223db61bdd22b31a984d8a891a49fdfc1e3e 100644 (file)
@@ -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),
     };