From 4b313dc74bc9bb84a542b7ec920cdb92879e7523 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 20 Jun 2016 00:57:16 +0000 Subject: feed: various object-orientation cleanups 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. --- lib/PublicInbox/View.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/View.pm') 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}) { -- cgit v1.2.3-24-ge0c7