]> Sergey Matveev's repositories - public-inbox.git/commitdiff
searchview: do not link Atom feed by relevance
authorEric Wong <e@80x24.org>
Mon, 14 Sep 2015 00:04:30 +0000 (00:04 +0000)
committerEric Wong <e@80x24.org>
Mon, 14 Sep 2015 00:09:54 +0000 (00:09 +0000)
Atom feeds only make sense when sorted by time, not when our
search indexing rules change and affect relevance.  So do not
include the relevance option when linking to Atom feeds.

However, we shall still honor the 'r' query parameter in case
somebody wants to manually include that in the URL for
testing/experimental purposes.  We simply will not advertise
it.

lib/PublicInbox/SearchView.pm

index b65351aa18b5250b4fb3a96cd55e39f22e776d57..6bc66ceb0ca68d35d9f0a82f29e3771f609d78b6 100644 (file)
@@ -108,7 +108,7 @@ sub search_nav_top {
                $rv .= qq{<a\nhref="?$s">summary</a>|};
                $rv .= qq{<b>threaded</b>};
        }
-       my $A = $q->qs_html(x => 'A');
+       my $A = $q->qs_html(x => 'A', r => undef);
        $rv .= qq{|<a\nhref="?$A">Atom</a>};
        $rv .= ']';
 }
@@ -216,7 +216,7 @@ sub html_start {
        my $query = PublicInbox::Hval->new_oneline($q->{q});
 
        my $qh = $query->as_html;
-       my $A = $q->qs_html(x => 'A');
+       my $A = $q->qs_html(x => 'A', r => undef);
        my $res = "<html><head><title>$qh - search results</title>" .
                qq{<link\nrel=alternate\ntitle="Atom feed"\n} .
                qq!href="?$A"\ntype="application/atom+xml"/></head>! .