Commit 853393e2 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 471324: Don't build mail headers for existing bugs (too many calls to…

Bug 471324: Don't build mail headers for existing bugs (too many calls to multiline_sprintf()) - Patch by Fré©ric Buclin <LpSolit@gmail.com> r=mkanat a=LpSolit
parent 43a24160
...@@ -548,26 +548,7 @@ sub sendMail { ...@@ -548,26 +548,7 @@ sub sendMail {
my %mailhead = %$dmhRef; my %mailhead = %$dmhRef;
my %fielddescription = %$fdRef; my %fielddescription = %$fdRef;
my @diffparts = @$diffRef; my @diffparts = @$diffRef;
my $head = "";
foreach my $f (@headerlist) {
if ($mailhead{$f}) {
my $value = $values{$f};
# If there isn't anything to show, don't include this header
if (! $value) {
next;
}
# Only send estimated_time if it is enabled and the user is in the group
if (($f ne 'estimated_time' && $f ne 'deadline')
|| $user->is_timetracker)
{
my $desc = $fielddescription{$f};
$head .= multiline_sprintf(FORMAT_DOUBLE, ["$desc:", $value],
FORMAT_2_SIZE);
}
}
}
# Build difftext (the actions) by verifying the user should see them # Build difftext (the actions) by verifying the user should see them
my $difftext = ""; my $difftext = "";
my $diffheader = ""; my $diffheader = "";
...@@ -619,6 +600,19 @@ sub sendMail { ...@@ -619,6 +600,19 @@ sub sendMail {
my $diffs = $difftext . "\n\n" . $newcomments; my $diffs = $difftext . "\n\n" . $newcomments;
if ($isnew) { if ($isnew) {
my $head = "";
foreach my $f (@headerlist) {
next unless $mailhead{$f};
my $value = $values{$f};
# If there isn't anything to show, don't include this header.
next unless $value;
# Only send estimated_time if it is enabled and the user is in the group.
if (($f ne 'estimated_time' && $f ne 'deadline') || $user->is_timetracker) {
my $desc = $fielddescription{$f};
$head .= multiline_sprintf(FORMAT_DOUBLE, ["$desc:", $value],
FORMAT_2_SIZE);
}
}
$diffs = $head . ($difftext ? "\n\n" : "") . $diffs; $diffs = $head . ($difftext ? "\n\n" : "") . $diffs;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment