about summary refs log tree commit homepage
path: root/lib/PublicInbox/View.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-06-20 00:57:16 +0000
committerEric Wong <e@80x24.org>2016-06-20 00:57:38 +0000
commit4b313dc74bc9bb84a542b7ec920cdb92879e7523 (patch)
treebdea400b15979d0d4206aa8aa840c71ed956eaca /lib/PublicInbox/View.pm
parent2724361ab69cd071c970c66e076784c582c76e42 (diff)
downloadpublic-inbox-4b313dc74bc9bb84a542b7ec920cdb92879e7523.tar.gz
Favor Inbox objects as our primary source of truth to simplify
our code.  This increases our coupling with PSGI to make it
easier to write tests in the future.

A lot of this code was originally designed to be usable
standalone without PSGI or CGI at all; but that might increase
development effort.
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r--lib/PublicInbox/View.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index e8ec0ed2..006da8d0 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -12,7 +12,7 @@ use Encode::MIME::Header;
 use Plack::Util;
 use PublicInbox::Hval qw/ascii_html/;
 use PublicInbox::Linkify;
-use PublicInbox::MID qw/mid_clean id_compress mid2path mid_mime/;
+use PublicInbox::MID qw/mid_clean id_compress mid_mime/;
 use PublicInbox::MsgIter;
 use PublicInbox::Address;
 use PublicInbox::WwwStream;
@@ -581,9 +581,10 @@ sub __thread_entry {
 
         # lazy load the full message from mini_mime:
         $mime = eval {
-                my $path = mid2path(mid_clean(mid_mime($mime)));
-                Email::MIME->new($state->{ctx}->{git}->cat_file('HEAD:'.$path));
+                my $mid = mid_clean(mid_mime($mime));
+                $state->{ctx}->{-inbox}->msg_by_mid($mid);
         } or return;
+        $mime = Email::MIME->new($mime);
 
         thread_html_head($mime, $state) if $state->{anchor_idx} == 0;
         if (my $ghost = delete $state->{ghost}) {