From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id ABE471F6D6 for ; Sun, 13 Sep 2015 22:35:47 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/3] view: add Atom links in headers for per-message links Date: Sun, 13 Sep 2015 22:35:47 +0000 Message-Id: <20150913223547.5083-3-e@80x24.org> In-Reply-To: <20150913223547.5083-1-e@80x24.org> References: <20150913223547.5083-1-e@80x24.org> List-Id: 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(-) diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index de2d667..7e1fb04 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 { -- EW