lib/PublicInbox/View.pm | 24 ++++++++++++++++-------- diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 530c878f70b1b3783ef7824a9b3ca8534c42402e..fc0cd77e1b0a1b7fbfe803cd91396f10974e4253 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -22,6 +22,7 @@ use PublicInbox::ViewDiff qw(flush_diff); use PublicInbox::Eml; use Time::Local qw(timegm); use PublicInbox::Smsg qw(subject_normalized); +use PublicInbox::ContentHash qw(content_hash); use constant COLS => 72; use constant INDENT => ' '; use constant TCHILD => '` '; @@ -35,9 +36,11 @@ $ctx->{smsg} = $ctx->{over}->next_by_mid(@{$ctx->{next_arg}}); $ctx->{mhref} = ($ctx->{nr} || $ctx->{smsg}) ? "../${\mid_href($smsg->{mid})}/" : ''; my $obuf = $ctx->{obuf} = _msg_page_prepare_obuf($eml, $ctx); - multipart_text_as_html($eml, $ctx); + if (length($$obuf)) { + multipart_text_as_html($eml, $ctx); + $$obuf .= '
WARNING: multiple messages have this Message-ID\n"; $rv .= '
';
} else {
$ctx->{first_hdr} = $eml->header_obj;
- if ($ctx->{smsg}) {
- $rv .=
-"WARNING: multiple messages have this Message-ID\n
";
- }
+ $ctx->{chash} = content_hash($eml) if $ctx->{smsg}; # reused MID
$rv .= ""; # anchor for body start
}
$ctx->{-upfx} = '../' if $over;