- } else {
- no warnings 'once';
- $th->order(*PublicInbox::View::rsort_ts);
- }
-
- my $git = $ctx->{git} ||= PublicInbox::Git->new($ctx->{git_dir});
- my $state = { ctx => $ctx, anchor_idx => 0, pct => \%pct };
- $ctx->{searchview} = 1;
- tdump_ent($fh, $git, $state, $_, 0) for $th->rootset;
- Email::Address->purge_cache;
-
- $fh->write(search_nav_bot($mset, $q). "\n\n" .
- foot($ctx). '</pre></body></html>');
-
- $fh->close;
-}
-
-sub tdump_ent {
- my ($fh, $git, $state, $node, $level) = @_;
- return unless $node;
- my $mime = $node->message;
-
- if ($mime) {
- # lazy load the full message from mini_mime:
- my $mid = $mime->header('Message-ID');
- $mime = eval {
- my $path = mid2path(mid_clean($mid));
- Email::MIME->new($git->cat_file('HEAD:'.$path));
- };