diff options
author | David Lawrence <dkl@mozilla.com> | 2014-10-06 17:52:33 +0200 |
---|---|---|
committer | David Lawrence <dkl@mozilla.com> | 2014-10-06 17:52:33 +0200 |
commit | aafa79dbed67514aede45f884572c30934854107 (patch) | |
tree | def39520441fdc097877f222a32cc86e5e6fda40 /Bugzilla/Flag.pm | |
parent | c034487bf62423265d0832197e0ff490f82330eb (diff) | |
parent | 3e1e67bed36bbe454c654f1e0a16ce73e724a5e0 (diff) | |
download | bugzilla-aafa79dbed67514aede45f884572c30934854107.tar.gz bugzilla-aafa79dbed67514aede45f884572c30934854107.tar.xz |
merged with upstream 4.2
Diffstat (limited to 'Bugzilla/Flag.pm')
-rw-r--r-- | Bugzilla/Flag.pm | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index d89a3adb4..e87f1f674 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -1045,18 +1045,32 @@ sub notify { $default_lang = Bugzilla::User->new()->setting('lang'); } + # Get comments on the bug + my $all_comments = $bug->comments({ after => $bug->lastdiffed }); + @$all_comments = grep { $_->type || $_->body =~ /\S/ } @$all_comments; + + # Get public only comments + my $public_comments = [ grep { !$_->is_private } @$all_comments ]; + foreach my $to (keys %recipients) { # Add threadingmarker to allow flag notification emails to be the # threaded similar to normal bug change emails. my $thread_user_id = $recipients{$to} ? $recipients{$to}->id : 0; - my $vars = { 'flag' => $flag, - 'old_flag' => $old_flag, - 'to' => $to, - 'date' => $timestamp, - 'bug' => $bug, - 'attachment' => $attachment, - 'threadingmarker' => build_thread_marker($bug->id, $thread_user_id) }; + # We only want to show private comments to users in the is_insider group + my $comments = $recipients{$to} && $recipients{$to}->is_insider + ? $all_comments : $public_comments; + + my $vars = { + flag => $flag, + old_flag => $old_flag, + to => $to, + date => $timestamp, + bug => $bug, + attachment => $attachment, + threadingmarker => build_thread_marker($bug->id, $thread_user_id), + new_comments => $comments, + }; my $lang = $recipients{$to} ? $recipients{$to}->setting('lang') : $default_lang; |