]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WWW.pm
view: depend on SearchMsg for Message-ID
[public-inbox.git] / lib / PublicInbox / WWW.pm
index 3fd77d42bff8bc561df675438601dc7a3608df2e..a2c2a4a6ff2944359ad2a5012c8f2f915279183e 100644 (file)
@@ -1,5 +1,5 @@
-# Copyright (C) 2014-2015 all contributors <meta@public-inbox.org>
-# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
+# Copyright (C) 2014-2018 all contributors <meta@public-inbox.org>
+# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 #
 # Main web interface for mailing list archives
 #
@@ -150,10 +150,8 @@ sub invalid_inbox ($$) {
        my $www = $ctx->{www};
        my $obj = $www->{pi_config}->lookup_name($inbox);
        if (defined $obj) {
-               $ctx->{git_dir} = $obj->{mainrepo};
                $ctx->{git} = $obj->git;
                $ctx->{-inbox} = $obj;
-               $ctx->{inbox} = $inbox;
                return;
        }
 
@@ -219,21 +217,16 @@ sub mid2blob {
 # /$INBOX/$MESSAGE_ID/raw                    -> raw mbox
 sub get_mid_txt {
        my ($ctx) = @_;
-       my $x = mid2blob($ctx) or return r404($ctx);
        require PublicInbox::Mbox;
-       PublicInbox::Mbox::emit1($ctx, $x);
+       PublicInbox::Mbox::emit_raw($ctx) || r404($ctx);
 }
 
 # /$INBOX/$MESSAGE_ID/                   -> HTML content (short quotes)
 sub get_mid_html {
        my ($ctx) = @_;
-       my $x = mid2blob($ctx) or return r404($ctx);
-
        require PublicInbox::View;
-       require PublicInbox::MIME;
-       my $mime = PublicInbox::MIME->new($x);
        searcher($ctx);
-       PublicInbox::View::msg_html($ctx, $mime);
+       PublicInbox::View::msg_page($ctx) || r404($ctx);
 }
 
 # /$INBOX/$MESSAGE_ID/t/