diff options
author | lpsolit%gmail.com <> | 2008-12-29 01:10:44 +0100 |
---|---|---|
committer | lpsolit%gmail.com <> | 2008-12-29 01:10:44 +0100 |
commit | 853393e27444887f3406f67de3a5928c4329d613 (patch) | |
tree | 3a89c58ec72930213e0588635ca12639a7096eed /Bugzilla | |
parent | 43a2416049c49a85ce84ede5567889d061a4e946 (diff) | |
download | bugzilla-853393e27444887f3406f67de3a5928c4329d613.tar.gz bugzilla-853393e27444887f3406f67de3a5928c4329d613.tar.xz |
Bug 471324: Don't build mail headers for existing bugs (too many calls to multiline_sprintf()) - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=LpSolit
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/BugMail.pm | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index 9a5e1a4c9..150e077d0 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; } |