lib/PublicInbox/SearchView.pm | 2 +- lib/PublicInbox/Smsg.pm | 9 +++------ lib/PublicInbox/View.pm | 2 +- diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index 91196ccafc9f21a710b6fe71bafadc18f190315c..e74ddb9056c81412877f4d40be4e748bbdba9603 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -122,7 +122,7 @@ $max //= $pct; $min = $pct; my $s = ascii_html($smsg->{subject}); - my $f = ascii_html($smsg->{from_name}); + my $f = ascii_html(delete $smsg->{from_name}); if ($obfs_ibx) { obfuscate_addrs($obfs_ibx, $s); obfuscate_addrs($obfs_ibx, $f); diff --git a/lib/PublicInbox/Smsg.pm b/lib/PublicInbox/Smsg.pm index fb28eff7326e06d19e05cc1a096fc55cf54b3bdd..a2f54507425f546785754770ba49fa87cb26417d 100644 --- a/lib/PublicInbox/Smsg.pm +++ b/lib/PublicInbox/Smsg.pm @@ -57,15 +57,12 @@ sub psgi_cull ($) { my ($self) = @_; - # ghosts don't have ->{from} - my $from = delete($self->{from}) // ''; - my @n = PublicInbox::Address::names($from); - $self->{from_name} = join(', ', @n); - # drop NNTP-only fields which aren't relevant to PSGI results: # saves ~80K on a 200 item search result: # TODO: we may need to keep some of these for JMAP... - delete @$self{qw(tid to cc bytes lines)}; + my ($f) = delete @$self{qw(from tid to cc bytes lines)}; + # ghosts don't have ->{from} + $self->{from_name} = join(', ', PublicInbox::Address::names($f // '')); $self; } diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index a6944b80bbed08ca41c702c234b1010571b1e5ac..116aa6418c4404475913b740f8ad373924077b8c 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -978,7 +978,7 @@ if ($level == 0 && $ctx->{skel_dump_roots}++) { $$skel .= delete($ctx->{sl_note}) || ''; } - my $f = ascii_html($smsg->{from_name}); + my $f = ascii_html(delete $smsg->{from_name}); my $obfs_ibx = $ctx->{-obfs_ibx}; obfuscate_addrs($obfs_ibx, $f) if $obfs_ibx;