summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2012-05-30 05:35:26 +0200
committerByron Jones <bjones@mozilla.com>2012-05-30 05:35:26 +0200
commit3c0e14b226413de856d198251aff4284e71d229a (patch)
tree366a3363a90b7742c5b105c6468d0f39769c7b8c /extensions
parentabfd756865aa89e742cdd2cf63b7ca6a8872df53 (diff)
downloadbugzilla-3c0e14b226413de856d198251aff4284e71d229a.tar.gz
bugzilla-3c0e14b226413de856d198251aff4284e71d229a.tar.xz
Bug 759340: Optimise SecureMail's comment loading
Diffstat (limited to 'extensions')
-rw-r--r--extensions/SecureMail/Extension.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/extensions/SecureMail/Extension.pm b/extensions/SecureMail/Extension.pm
index e5a082380..1a94fe48c 100644
--- a/extensions/SecureMail/Extension.pm
+++ b/extensions/SecureMail/Extension.pm
@@ -242,15 +242,15 @@ sub mailer_before_send {
# If the insider group has securemail enabled..
my $insider_group = Bugzilla::Group->new({ name => Bugzilla->params->{'insidergroup'} });
if ($insider_group->{secure_mail} && $make_secure == SECURE_NONE) {
+ my $comment_is_private = Bugzilla->dbh->selectcol_arrayref(
+ "SELECT isprivate FROM longdescs WHERE bug_id=? ORDER BY bug_when",
+ undef, $bug_id);
# Encrypt if there are private comments on an otherwise public bug
while ($body =~ /[\r\n]--- Comment #(\d+)/g) {
- my $comment_id = $1;
- if ($comment_id) {
- my ($comment) = grep { $_->{count} == $comment_id } @{ $bug->comments };
- if ($comment && $comment->is_private) {
- $make_secure = SECURE_BODY;
- last;
- }
+ my $comment_number = $1;
+ if ($comment_number && $comment_is_private->[$comment_number]) {
+ $make_secure = SECURE_BODY;
+ last;
}
}
# Encrypt if updating a private attachment without a comment