diff options
author | Eric Wong <e@80x24.org> | 2017-06-16 02:03:32 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-06-16 02:03:32 +0000 |
commit | ef9ce6f2dfc9fcbb91e3cec0b7a2b7f7e359be5d (patch) | |
tree | 4db5b56762cf95c2164fb3815ee4d12fca7c6803 /lib/PublicInbox/SearchView.pm | |
parent | 61196e5b0645eb58b415b4c679fc36ecf602ad16 (diff) | |
download | public-inbox-ef9ce6f2dfc9fcbb91e3cec0b7a2b7f7e359be5d.tar.gz |
This is lightly-tested and seems to work. I'm still hesitant to support this, but the alternative of receiving death threats for displaying unobfuscated addresses seems to be not worth it.
Diffstat (limited to 'lib/PublicInbox/SearchView.pm')
-rw-r--r-- | lib/PublicInbox/SearchView.pm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index f92790f4..777710e3 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -7,7 +7,7 @@ use strict; use warnings; use URI::Escape qw(uri_unescape uri_escape); use PublicInbox::SearchMsg; -use PublicInbox::Hval qw/ascii_html/; +use PublicInbox::Hval qw/ascii_html obfuscate_addrs/; use PublicInbox::View; use PublicInbox::WwwAtomStream; use PublicInbox::MID qw(mid2path mid_mime mid_clean mid_escape MID_ESC); @@ -89,6 +89,7 @@ sub mset_summary { my $pfx = ' ' x $pad; my $res = \($ctx->{-html_tip}); my $srch = $ctx->{srch}; + my $obfs = $ctx->{-inbox}->{obfuscate}; foreach my $m ($mset->items) { my $rank = sprintf("%${pad}d", $m->get_rank + 1); my $pct = $m->get_percent; @@ -102,6 +103,10 @@ sub mset_summary { } my $s = ascii_html($smsg->subject); my $f = ascii_html($smsg->from_name); + if ($obfs) { + obfuscate_addrs($s); + obfuscate_addrs($f); + } my $ts = PublicInbox::View::fmt_ts($smsg->ts); my $mid = PublicInbox::Hval->new_msgid($smsg->mid)->{href}; $$res .= qq{$rank. <b><a\nhref="$mid/">}. @@ -223,8 +228,11 @@ sub mset_thread { $ctx->{seen} = {}; $ctx->{s_nr} = scalar(@$msgs).'+ results'; + # reduce hash lookups in skel_dump + $ctx->{-obfuscate} = $ctx->{-inbox}->{obfuscate}; PublicInbox::View::walk_thread($rootset, $ctx, *PublicInbox::View::pre_thread); + @$msgs = reverse @$msgs if $r; my $mime; sub { |