my $obfs_ibx = $ctx->{-obfs_ibx};
my $rv = '';
my $mids = mids($hdr);
- my $multiple = scalar(@$mids) > 1; # zero, one, infinity
if ($nr == 0) {
if ($more) {
$rv .=
$rv .= "Date: $v\n";
}
$ctx->{-title_html} = join(' - ', @title);
- foreach (@$mids) {
- my $mid = PublicInbox::Hval->new_msgid($_) ;
+ if (scalar(@$mids) == 1) { # common case
+ my $mid = PublicInbox::Hval->new_msgid($mids->[0]);
my $mhtml = $mid->as_html;
- if ($multiple) {
+ $rv .= "Message-ID: <$mhtml> ";
+ $rv .= "(<a\nhref=\"raw\">raw</a>)\n";
+ } else {
+ foreach (@$mids) {
+ my $mid = PublicInbox::Hval->new_msgid($_);
+ my $mhtml = $mid->as_html;
my $href = $mid->{href};
$rv .= "Message-ID: ";
- $rv .= "<a\nhref=\"../$href/\">";
- $rv .= "<$mhtml></a> ";
+ $rv .= "<<a\nhref=\"../$href/\">$mhtml</a>> ";
$rv .= "(<a\nhref=\"../$href/raw\">raw</a>)\n";
- } else {
- $rv .= "Message-ID: <$mhtml> ";
- $rv .= "(<a\nhref=\"raw\">raw</a>)\n";
}
}
$rv .= _parent_headers($hdr, $over);
@from_ = ($raw =~ m/>From: /mg);
is(scalar(@from_), 3, 'three From: lines');
foreach my $mid ('a-mid@b', $new_mid, $third) {
- like($raw, qr/<\Q$mid\E>/s, "Message-ID $mid shown");
+ like($raw, qr!>\Q$mid\E</a>!s, "Message-ID $mid shown");
}
like($raw, qr/\b3\+ messages\b/, 'thread overview shown');