From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.7 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 011041FAE4 for ; Sun, 23 Aug 2015 22:35:46 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] view: simplify root filtering in followup display Date: Sun, 23 Aug 2015 22:35:45 +0000 Message-Id: <1440369345-13435-3-git-send-email-e@80x24.org> List-Id: 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