about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-04-06 08:23:15 +0000
committerEric Wong <e@80x24.org>2016-04-06 08:25:09 +0000
commit7fe73c43efaa408d4dc8a5d8b9988feef7ff9f19 (patch)
treedc49217070ce9ed659532cc93dc8c48407e63d8b /lib
parent57502a7c27dd971d99def287bcc02949ba854d93 (diff)
downloadpublic-inbox-7fe73c43efaa408d4dc8a5d8b9988feef7ff9f19.tar.gz
In the per-message view, we still need to account for threads
lacking a common parent.  This can happen when threads are
broken by some broken clients or if somebody sends the same
message twice to the same inbox with a different Message-ID.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/View.pm19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index c25c5d57..070240ec 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -819,13 +819,18 @@ sub inline_dump {
                 my $mid = mid_clean($hdr->header_raw('Message-ID'));
                 _inline_header($dst, $state, $upfx, $hdr, $level);
         } else {
-                my $dot = $level == 0 ? '' : '` ';
-                my $pfx = '      [not found] ' .  indent_for($level) . $dot;
-                $$dst .= $pfx;
-                my $mid = PublicInbox::Hval->new_msgid($node->messageid);
-                my $href = $mid->as_href;
-                my $html = $mid->as_html;
-                $$dst .= qq{&lt;<a\nhref="$upfx../$href/">$html</a>&gt;\n};
+                my $mid = $node->messageid;
+                if ($mid eq 'subject dummy') {
+                        $$dst .= "\t[no common parent]\n";
+                } else {
+                        $$dst .= '      [not found] ';
+                        my $dot = $level == 0 ? '' : '` ';
+                        $$dst .= indent_for($level) . $dot;
+                        $mid = PublicInbox::Hval->new_msgid($mid);
+                        my $href = "$upfx../" . $mid->as_href . '/';
+                        my $html = $mid->as_html;
+                        $$dst .= qq{&lt;<a\nhref="$href">$html</a>&gt;\n};
+                }
         }
         inline_dump($dst, $state, $upfx, $node->child, $level+1);
         inline_dump($dst, $state, $upfx, $node->next, $level);