From 6ffa9c19e710ee2ece98a987477e9c5baaca13cd Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 12 Sep 2015 01:23:32 +0000 Subject: searchview: support displaying entire threads This hopefully makes it easy to perform queries to display an entire thread. Raise the limit in the threaded view to display more results and hopefully improve the output of thread display. --- lib/PublicInbox/View.pm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'lib/PublicInbox/View.pm') diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 7d855550..de2d667c 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -72,7 +72,7 @@ sub index_entry { my $subj = $mime->header('Subject'); my $header_obj = $mime->header_obj; - my $mid_raw = $header_obj->header('Message-ID'); + my $mid_raw = mid_clean($header_obj->header('Message-ID')); my $id = anchor_for($mid_raw); my $seen = $state->{seen}; $seen->{$id} = "#$id"; # save the anchor for children, later @@ -139,7 +139,9 @@ sub index_entry { } $rv .= " parent"; } - if ($srch) { + if (my $pct = $state->{pct}) { + $rv .= " [$pct->{$mid_raw}%]"; + } elsif ($srch) { if ($ctx->{flat}) { $rv .= " [threaded" . "|flat]"; @@ -601,6 +603,14 @@ sub ghost_parent { qq{[parent not found: <$html>]}; } +sub ghost_table { + my ($upfx, $mid, $level) = @_; + "" . + (INDENT x $level) . "" . + PRE_WRAP . ghost_parent($upfx, $mid) . + ''; +} + sub __thread_entry { my ($cb, $git, $state, $mime, $level) = @_; @@ -617,10 +627,7 @@ sub __thread_entry { if (my $ghost = delete $state->{ghost}) { # n.b. ghost messages may only be parents, not children foreach my $g (@$ghost) { - $$cb->write("" . - (INDENT x $g->[1]) . "" . - PRE_WRAP . ghost_parent('../../', $g->[0]) . - ''); + $$cb->write(ghost_table('../../', @$g)); } } index_entry($$cb, $mime, $level, $state); -- cgit v1.2.3-24-ge0c7