Some mail user agents use this header, and Mail::Thread uses
it, too, so show it if possible, but only if it's not redundant
to In-Reply-To.
my $irp = $header_obj->header_raw('In-Reply-To');
if (defined $irp) {
my $irp = $header_obj->header_raw('In-Reply-To');
if (defined $irp) {
- $irp = PublicInbox::Hval->new_msgid($irp);
- my $html = $irp->as_html;
- my $href = $irp->as_href;
+ my $v = PublicInbox::Hval->new_msgid(my $tmp = $irp);
+ my $html = $v->as_html;
+ my $href = $v->as_href;
$rv .= "In-Reply-To: <";
$rv .= "<a href=\"$href.html\">$html</a>>\n";
}
$rv .= "In-Reply-To: <";
$rv .= "<a href=\"$href.html\">$html</a>>\n";
}
+
+ my $refs = $header_obj->header_raw('References');
+ if ($refs) {
+ $refs =~ s/\s*\Q$irp\E\s*// if (defined $irp);
+ my @refs = ($refs =~ /<([^>]+)>/g);
+ if (@refs) {
+ $rv .= 'References: '. linkify_refs(@refs) . "\n";
+ }
+ }
+
$rv .= "\n";
("<html><head><title>". join(' - ', @title) .
$rv .= "\n";
("<html><head><title>". join(' - ', @title) .
'<a href="' . ascii_html($href) . '">reply</a>';
}
'<a href="' . ascii_html($href) . '">reply</a>';
}
+sub linkify_refs {
+ join(' ', map {
+ my $v = PublicInbox::Hval->new_msgid($_);
+ my $html = $v->as_html;
+ my $href = $v->as_href;
+ "<<a href=\"$href.html\">$html</a>>";
+ } @_);
+}
+