From 853393e27444887f3406f67de3a5928c4329d613 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Mon, 29 Dec 2008 00:10:44 +0000 Subject: [PATCH] =?utf8?q?Bug=20471324:=20Don't=20build=20mail=20headers?= =?utf8?q?=20for=20existing=20bugs=20(too=20many=20calls=20to=20multiline?= =?utf8?q?=5Fsprintf())=20-=20Patch=20by=20Fr=C3=83=C2=A9d=C3=83=C2=A9ric?= =?utf8?q?=20Buclin=20=20r=3Dmkanat=20a=3DLpSolit?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Bugzilla/BugMail.pm | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index 9a5e1a4c90..150e077d0c 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -548,26 +548,7 @@ sub sendMail { my %mailhead = %$dmhRef; my %fielddescription = %$fdRef; 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 my $difftext = ""; my $diffheader = ""; @@ -619,6 +600,19 @@ sub sendMail { my $diffs = $difftext . "\n\n" . $newcomments; 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; } -- 2.47.2