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=-2.8 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 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 86FE32044E; Wed, 6 Apr 2016 08:26:50 +0000 (UTC) Date: Wed, 6 Apr 2016 08:26:50 +0000 From: Eric Wong To: meta@public-inbox.org Cc: Eric Wong Subject: [PATCH] view: account for threads lacking a common parent Message-ID: <20160406082650.GA1185@dcvr.yhbt.net> References: <20160406080807.20234-1-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160406080807.20234-1-e@80x24.org> List-Id: 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. --- lib/PublicInbox/View.pm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index c25c5d5..070240e 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{<$html>\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{<$html>\n}; + } } inline_dump($dst, $state, $upfx, $node->child, $level+1); inline_dump($dst, $state, $upfx, $node->next, $level); -- EW