about summary refs log tree commit homepage
path: root/lib/PublicInbox/Address.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-07-01 06:11:13 +0000
committerEric Wong <e@80x24.org>2016-07-01 06:11:13 +0000
commitc056071159932b3b9c8454314887b6f45de2ae0f (patch)
tree94bfc8e945f84ca25fdef98c6c372f7dac0645de /lib/PublicInbox/Address.pm
parenta5719018b856d1763ca7faebfc0ffa82fb57320a (diff)
downloadpublic-inbox-c056071159932b3b9c8454314887b6f45de2ae0f.tar.gz
It seems common for address entries to end up as:
	"foo@example" <foo@example>

Avoid needlessly displaying the domain name in that case.
Diffstat (limited to 'lib/PublicInbox/Address.pm')
-rw-r--r--lib/PublicInbox/Address.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/Address.pm b/lib/PublicInbox/Address.pm
index cd5fbfbe..e17d0b57 100644
--- a/lib/PublicInbox/Address.pm
+++ b/lib/PublicInbox/Address.pm
@@ -16,7 +16,9 @@ sub names {
                 my $e = $1;
                 s/\A['"\s]*//;
                 s/['"\s]*\z//;
-                $_ =~ /\S/ ? $_ : $e;
+                $e = $_ =~ /\S/ ? $_ : $e;
+                $e =~ s/\@\S+\z//;
+                $e;
         } split(/\@+[\w\.\-]+>?\s*(?:,\s*|\z)/, $_[0]);
 }