From 0bd1fb36dded212c6f388599347501e2ca6b201b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 13 Sep 2015 22:35:47 +0000 Subject: view: add Atom links in headers for per-message links Some user agents will advertise the presence of a feed this way for users to subscribe to individual topics. --- lib/PublicInbox/View.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index de2d667c..7e1fb045 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -432,15 +432,19 @@ sub headers_to_html_header { $rv .= 'Message-ID: <' . $mid->as_html . '> '; my $upfx = $full_pfx ? '' : '../'; $rv .= "(raw)\n"; + my $atom; if ($srch) { $rv .= "References: [expand]\n"; + $atom = qq{!; } else { $rv .= _parent_headers_nosrch($header_obj); + $atom = ''; } $rv .= "\n"; ("". join(' - ', @title) . - '' . PRE_WRAP . $rv); + "$atom" . PRE_WRAP . $rv); } sub thread_inline { @@ -578,12 +582,15 @@ sub anchor_for { } sub thread_html_head { - my ($cb, $mime) = @_; + my ($cb, $header, $state) = @_; $$cb = $$cb->([200, ['Content-Type'=> 'text/html; charset=UTF-8']]); - my $s = PublicInbox::Hval->new_oneline($mime->header('Subject')); + my $s = PublicInbox::Hval->new_oneline($header->header('Subject')); $s = $s->as_html; - $$cb->write("$s"); + $$cb->write("$s". + qq{! . + ""); } sub pre_anchor_entry { -- cgit v1.2.3-24-ge0c7