diff options
author | Dave Lawrence <dkl@redhat.com> | 2010-02-10 18:55:38 +0100 |
---|---|---|
committer | Dave Lawrence <dkl@redhat.com> | 2010-02-10 18:55:38 +0100 |
commit | 80477beb472a83f6fa711358372db9edf6209c39 (patch) | |
tree | c2bfc902d85f18527462ffff83d4060b335aece1 /Bugzilla/BugMail.pm | |
parent | c6c99bcc594d33553921ca111f05f374330d5d4d (diff) | |
download | bugzilla-80477beb472a83f6fa711358372db9edf6209c39.tar.gz bugzilla-80477beb472a83f6fa711358372db9edf6209c39.tar.xz |
Bug 310450 - Bugzilla should send an email when a comment becomes private or un-private
r=mkanat, a=mkanat
Diffstat (limited to 'Bugzilla/BugMail.pm')
-rw-r--r-- | Bugzilla/BugMail.pm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index f7af921eb..7412838f7 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -238,7 +238,8 @@ sub Send { my $diffs = $dbh->selectall_arrayref( "SELECT profiles.login_name, profiles.realname, fielddefs.description, bugs_activity.bug_when, bugs_activity.removed, - bugs_activity.added, bugs_activity.attach_id, fielddefs.name + bugs_activity.added, bugs_activity.attach_id, fielddefs.name, + bugs_activity.comment_id FROM bugs_activity INNER JOIN fielddefs ON fielddefs.id = bugs_activity.fieldid @@ -256,7 +257,7 @@ sub Send { my $fullwho; my @changedfields; foreach my $ref (@$diffs) { - my ($who, $whoname, $what, $when, $old, $new, $attachid, $fieldname) = (@$ref); + my ($who, $whoname, $what, $when, $old, $new, $attachid, $fieldname, $comment_id) = (@$ref); my $diffpart = {}; if ($who ne $lastwho) { $lastwho = $who; @@ -279,6 +280,12 @@ sub Send { 'SELECT isprivate FROM attachments WHERE attach_id = ?', undef, ($attachid)); } + if ($fieldname eq 'longdescs.isprivate') { + my $comment = Bugzilla::Comment->new($comment_id); + my $comment_num = $comment->count; + $what =~ s/^(Comment )?/Comment #$comment_num /; + $diffpart->{'isprivate'} = $new; + } $difftext = three_columns($what, $old, $new); $diffpart->{'header'} = $diffheader; $diffpart->{'fieldname'} = $fieldname; |