about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-23 22:28:10 +0000
committerEric Wong <e@80x24.org>2015-08-23 22:35:21 +0000
commit9460e8b6de77374f2eda4ff2cd0ee88bd47cea40 (patch)
treea47ea9d492266a84efcd534cdff0eed615dd2950
parentaf10d15487fa9f4086c8f5c74d7ee737997ed905 (diff)
downloadpublic-inbox-9460e8b6de77374f2eda4ff2cd0ee88bd47cea40.tar.gz
The root message-ID may be too long to compare.  Instead,
check fields based on the consistency of our DB.
-rw-r--r--lib/PublicInbox/View.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 72bbb946..cf582688 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;
 }