]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WWW.pm
mbox: generate Archived-At, List-Post, List-Archive headers
[public-inbox.git] / lib / PublicInbox / WWW.pm
index 2718854c6b6f28523344aa84a33ecd6190943ef9..fb57163ef44499abfe03b487617ff87f69dbe661 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014, Eric Wong <normalperson@yhbt.net> and all contributors
+# Copyright (C) 2014-2015 all contributors <meta@public-inbox.org>
 # License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
 #
 # We focus on the lowest common denominators here:
@@ -79,6 +79,7 @@ sub r404 {
        my ($ctx) = @_;
        if ($ctx && $ctx->{mid}) {
                require PublicInbox::ExtMsg;
+               searcher($ctx);
                return PublicInbox::ExtMsg::ext_msg($ctx);
        }
        r(404, 'Not Found');
@@ -129,11 +130,10 @@ sub get_index {
        my ($ctx) = @_;
        require PublicInbox::Feed;
        my $srch = searcher($ctx);
-       my $q = $ctx->{cgi}->param('q');
        footer($ctx);
-       if (defined $q) {
+       if (defined $ctx->{cgi}->param('q')) {
                require PublicInbox::SearchView;
-               PublicInbox::SearchView::sres_top_html($ctx, $q);
+               PublicInbox::SearchView::sres_top_html($ctx);
        } else {
                PublicInbox::Feed::generate_html_index($ctx);
        }
@@ -163,7 +163,7 @@ sub get_mid_txt {
        my ($ctx) = @_;
        my $x = mid2blob($ctx) or return r404($ctx);
        require PublicInbox::Mbox;
-       PublicInbox::Mbox::emit1($x);
+       PublicInbox::Mbox::emit1($ctx, $x);
 }
 
 # /$LISTNAME/$MESSAGE_ID/                   -> HTML content (short quotes)