diff options
author | Eric Wong <e@80x24.org> | 2016-06-20 00:57:16 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-06-20 00:57:38 +0000 |
commit | 4b313dc74bc9bb84a542b7ec920cdb92879e7523 (patch) | |
tree | bdea400b15979d0d4206aa8aa840c71ed956eaca /lib/PublicInbox/NNTP.pm | |
parent | 2724361ab69cd071c970c66e076784c582c76e42 (diff) | |
download | public-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/NNTP.pm')
-rw-r--r-- | lib/PublicInbox/NNTP.pm | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index e8683210..93f654f6 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -10,7 +10,6 @@ use fields qw(nntpd article rbuf ng long_res); use PublicInbox::Search; use PublicInbox::Msgmap; use PublicInbox::Git; -use PublicInbox::MID qw(mid2path); require PublicInbox::EvCleanup; use Email::Simple; use POSIX qw(strftime); @@ -481,10 +480,9 @@ find_mid: defined $mid or return $err; } found: - my $o = 'HEAD:' . mid2path($mid); my $bytes; - my $s = eval { Email::Simple->new($ng->git->cat_file($o, \$bytes)) }; - return $err unless $s; + my $s = eval { $ng->msg_by_mid($mid, \$bytes) } or return $err; + $s = Email::Simple->new($s); my $lines; if ($set_headers) { set_nntp_headers($s->header_obj, $ng, $n, $mid); |