summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorreed%reedloden.com <>2006-12-27 10:12:35 +0100
committerreed%reedloden.com <>2006-12-27 10:12:35 +0100
commitd8d2ca30e3780b4693ba42a0315e3f00f1884ebc (patch)
tree096aeece81883e574793e9628236e01e89d93707 /Bugzilla
parentebeb2f54a4318173d6acbd589b00cf35422a445d (diff)
downloadbugzilla-d8d2ca30e3780b4693ba42a0315e3f00f1884ebc.tar.gz
bugzilla-d8d2ca30e3780b4693ba42a0315e3f00f1884ebc.tar.xz
Bug 364958 - "If user does not have a real name, just e-mail address should be displayed instead of " <user@email.tld>"" [p=reed r=bkor a=justdave]
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/BugMail.pm17
1 files changed, 12 insertions, 5 deletions
diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm
index 6e0f57401..d6404f2eb 100644
--- a/Bugzilla/BugMail.pm
+++ b/Bugzilla/BugMail.pm
@@ -220,14 +220,16 @@ sub Send {
my $diffheader = "";
my @diffparts;
my $lastwho = "";
+ my $fullwho;
my @changedfields;
foreach my $ref (@$diffs) {
my ($who, $whoname, $what, $when, $old, $new, $attachid, $fieldname) = (@$ref);
my $diffpart = {};
if ($who ne $lastwho) {
$lastwho = $who;
- $diffheader = "\n$whoname <$who" . Bugzilla->params->{'emailsuffix'}
- . "> changed:\n\n";
+ $fullwho = $whoname ? "$whoname <$who" . Bugzilla->params->{'emailsuffix'} . ">" :
+ "$who" . Bugzilla->params->{'emailsuffix'};
+ $diffheader = "\n$fullwho changed:\n\n";
$diffheader .= FormatTriple("What ", "Removed", "Added");
$diffheader .= ('-' x 76) . "\n";
}
@@ -691,9 +693,14 @@ sub prepare_comments {
my $result = "";
foreach my $comment (@$raw_comments) {
if ($count) {
- $result .= "\n\n--- Comment #$count from " . $comment->{'name'} . " <" .
- $comment->{'email'} . Bugzilla->params->{'emailsuffix'} . "> " .
- format_time($comment->{'time'}) . " ---\n";
+ $result .= "\n\n--- Comment #$count from ";
+ if ($comment->{'name'} eq $comment->{'email'}) {
+ $result .= $comment->{'email'} . Bugzilla->params->{'emailsuffix'};
+ } else {
+ $result .= $comment->{'name'} . " <" . $comment->{'email'} .
+ Bugzilla->params->{'emailsuffix'} . ">";
+ }
+ $result .= " " . format_time($comment->{'time'}) . " ---\n";
}
# Format language specific comments. We don't update $comment->{'body'}
# directly, otherwise it would grow everytime you call format_comment()