* [PATCH] view: simplify root filtering in followup display
@ 2015-08-23 22:35 Eric Wong
0 siblings, 0 replies; only message in thread
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 [flat|nested] only message in thread
only message in thread, other threads:[~2015-08-23 22:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-23 22:35 [PATCH] view: simplify root filtering in followup display Eric Wong
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).