]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: wire up mbox.gz links
authorEric Wong <e@80x24.org>
Sat, 22 Aug 2015 11:41:24 +0000 (11:41 +0000)
committerEric Wong <e@80x24.org>
Sat, 22 Aug 2015 11:42:38 +0000 (11:42 +0000)
To reduce clutter, we will not link to uncompressed versions.
Users should be able to download entire threads for offline
reading, enable this feature for them.

lib/PublicInbox/View.pm

index e3339066e27d7303440c18905219d12ca3717114..fe37a9fc618e8e68d95bcdfa2bd0cf9cdf8426b1 100644 (file)
@@ -168,6 +168,8 @@ sub emit_thread_html {
        my $next = "<a\nid=\"s$final_anchor\">";
        $next .= $final_anchor == 1 ? 'only message in' : 'end of';
        $next .= " thread</a>, back to <a\nhref=\"../\">index</a>\n";
+       $mid = PublicInbox::Hval->new_msgid($mid)->as_href;
+       $next .= "download: <a\nhref=\"$mid.mbox.gz\">mbox.gz</a>\n\n";
        $fh->write("<hr />" . PRE_WRAP . $next . $foot .
                   "</pre></body></html>");
        $fh->close;