user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH] view: simplify root filtering in followup display
@ 2015-08-23 22:35  7% Eric Wong
  0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2015-08-23 22:35 UTC (permalink / raw)
  To: meta

The root message-ID may be too long to compare.  Instead,
check fields based on the consistency of our DB.
---
 lib/PublicInbox/View.pm | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 72bbb94..cf58268 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -483,10 +483,12 @@ sub anchor_for {
 sub simple_dump {
 	my ($dst, $root, $node, $level) = @_;
 	return unless $node;
-	# $root = [ Root Message-ID, \%seen, $srch ];
+	# $root = [ undef, \%seen, $srch ];
 	if (my $x = $node->message) {
-		my $mid = $x->header('Message-ID');
-		if ($root->[0] ne $mid) {
+		my $f = $x->header('X-PI-From');
+		my $d = $x->header('X-PI-Date');
+		if (defined $f && defined $d) {
+			my $mid = $x->header('Message-ID');
 			my $pfx = '  ' x $level;
 			$$dst .= $pfx;
 			my $s = $x->header('Subject');
@@ -499,8 +501,8 @@ sub simple_dump {
 				$s = $s->as_html;
 			}
 			my $m = PublicInbox::Hval->new_msgid($mid);
-			my $f = PublicInbox::Hval->new($x->header('X-PI-From'));
-			my $d = PublicInbox::Hval->new($x->header('X-PI-Date'));
+			$f = PublicInbox::Hval->new($f);
+			$d = PublicInbox::Hval->new($d);
 			$m = $m->as_href . '.html';
 			$f = $f->as_html;
 			$d = $d->as_html . ' UTC';
@@ -525,7 +527,7 @@ sub thread_followups {
 	my $srch = $res->{srch};
 	my $subj = $srch->subject_path($root->header('Subject'));
 	my %seen = ($subj => 1);
-	$root = [ $root->header('Message-ID'), \%seen, $srch ];
+	$root = [ undef, \%seen, $srch ];
 	simple_dump($dst, $root, $_, 0) for $th->rootset;
 }
 
-- 
EW


^ permalink raw reply related	[relevance 7%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-08-23 22:35  7% [PATCH] view: simplify root filtering in followup display Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).