lib/PublicInbox/View.pm | 31 ++++++++++++++++---------------
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 68adbd72840592dccb87cc1e37c151eb4b4795c9..65ef1e786ddec5853448b6cf4e4eef2c6c1d4a46 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -591,6 +591,17 @@ my $id = anchor_for($mime->header('Message-ID'));
$seen->{$id} = "#$id"; # save the anchor for children, later
}
+sub ghost_parent {
+ my ($upfx, $mid) = @_;
+ # 'subject dummy' is used internally by Mail::Thread
+ return '[no common parent]' if ($mid eq 'subject dummy');
+
+ $mid = PublicInbox::Hval->new_msgid($mid);
+ my $href = $mid->as_href;
+ my $html = $mid->as_html;
+ qq{[parent not found: <$html>]};
+}
+
sub __thread_entry {
my ($cb, $git, $state, $mime, $level) = @_;
@@ -607,15 +618,10 @@
if (my $ghost = delete $state->{ghost}) {
# n.b. ghost messages may only be parents, not children
foreach my $g (@$ghost) {
- my $mid = PublicInbox::Hval->new_msgid($g->[0]);
- my $pfx = INDENT x $g->[1];
- my $href = $mid->as_href;
- my $html = $mid->as_html;
- $$cb->write("
| $pfx | " .
- PRE_WRAP .
- '[parent not found: <' .
- qq{}.
- "$html>] |
");
+ $$cb->write("| " .
+ (INDENT x $g->[1]) . " | " .
+ PRE_WRAP . ghost_parent('', $g->[0]) .
+ ' |
');
}
}
index_entry($$cb, $mime, $level, $state);
@@ -736,12 +742,7 @@ }
_inline_header($dst, $state, $upfx, $mime, $level);
} else {
my $pfx = INDENT x $level;
- my $v = PublicInbox::Hval->new_msgid($node->messageid, 1);
- my $html = $v->as_html;
- my $href = $v->as_href;
- $$dst .= $pfx . '` [parent not found: <' .
- qq{}.
- "$html>]\n";
+ $$dst .= $pfx . '` ' . ghost_parent($upfx, $node->messageid);
}
inline_dump($dst, $state, $upfx, $node->child, $level+1);
inline_dump($dst, $state, $upfx, $node->next, $level);