X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FSearchView.pm;h=828926c721790b2e9ad3176e6f7284c69eb2b873;hb=95bdac7f09c69036efed537a4d03d5bdd2ae4eb6;hp=6587d37fb9f94011e955ada6cb6139172cddd398;hpb=65e3cc8f6cc73e45db827cbeee4ccecbf1502496;p=public-inbox.git
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index 6587d37f..828926c7 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2019 all contributors
+# Copyright (C) 2015-2020 all contributors
# License: AGPL-3.0+
#
# Displays search results for the web interface
@@ -10,14 +10,11 @@ use PublicInbox::SearchMsg;
use PublicInbox::Hval qw/ascii_html obfuscate_addrs/;
use PublicInbox::View;
use PublicInbox::WwwAtomStream;
-use PublicInbox::MID qw(MID_ESC);
-use PublicInbox::MIME;
-require PublicInbox::Git;
-require PublicInbox::SearchThread;
+use PublicInbox::SearchThread;
our $LIM = 200;
my %rmap_inc;
-sub noop {}
+my $noop = sub {};
sub mbox_results {
my ($ctx) = @_;
@@ -62,7 +59,7 @@ retry:
if ($err) {
$code = 400;
$ctx->{-html_tip} = ''.err_txt($ctx, $err).'
';
- $cb = *noop;
+ $cb = $noop;
} elsif ($total == 0) {
if (defined($ctx->{-uxs_retried})) {
# undo retry damage:
@@ -74,7 +71,7 @@ retry:
}
$code = 404;
$ctx->{-html_tip} = "\n[No results found]
";
- $cb = *noop;
+ $cb = $noop;
} else {
return adump($_[0], $mset, $q, $ctx) if $x eq 'A';
@@ -125,7 +122,7 @@ sub mset_summary {
$$res .= "$pfx - by $f @ $date UTC [$pct%]\n\n";
}
$$res .= search_nav_bot($mset, $q);
- *noop;
+ $noop;
}
# shorten "/full/path/to/Foo/Bar.pm" to "Foo/Bar.pm" so error
@@ -280,7 +277,7 @@ sub mset_thread {
$ctx->{-upfx} = '';
$ctx->{anchor_idx} = 1;
$ctx->{cur_level} = 0;
- $ctx->{dst} = \$skel;
+ $ctx->{skel} = \$skel;
$ctx->{mapping} = {};
$ctx->{searchview} = 1;
$ctx->{prev_attr} = '';
@@ -290,7 +287,7 @@ sub mset_thread {
# reduce hash lookups in skel_dump
$ctx->{-obfuscate} = $ctx->{-inbox}->{obfuscate};
PublicInbox::View::walk_thread($rootset, $ctx,
- *PublicInbox::View::pre_thread);
+ \&PublicInbox::View::pre_thread);
@$msgs = reverse @$msgs if $r;
$ctx->{msgs} = $msgs;
@@ -306,7 +303,7 @@ sub mset_thread_i {
return PublicInbox::View::index_entry($smsg, $ctx,
scalar @$msgs);
}
- my ($skel) = delete @$ctx{qw(dst msgs)};
+ my ($skel) = delete @$ctx{qw(skel msgs)};
$$skel .= "\n";
}
@@ -350,7 +347,6 @@ package PublicInbox::SearchQuery;
use strict;
use warnings;
use URI::Escape qw(uri_escape);
-use PublicInbox::Hval;
use PublicInbox::MID qw(MID_ESC);
sub new {