]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Inbox.pm
replace most uses of PublicInbox::MIME with Eml
[public-inbox.git] / lib / PublicInbox / Inbox.pm
index 4bd82989489477526bd3129b272016abc2be8e11..617b692b14ca10688c57ce84c9148a56a1340940 100644 (file)
@@ -7,7 +7,7 @@ use strict;
 use warnings;
 use PublicInbox::Git;
 use PublicInbox::MID qw(mid2path);
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 
 # Long-running "git-cat-file --batch" processes won't notice
 # unlinked packs, so we need to restart those processes occasionally.
@@ -311,9 +311,7 @@ sub nntp_usable {
 # for v1 users w/o SQLite only
 sub msg_by_path ($$;$) {
        my ($self, $path, $ref) = @_;
-       my $str = git($self)->cat_file('HEAD:'.$path, $ref);
-       $$str =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s if $str;
-       $str;
+       git($self)->cat_file('HEAD:'.$path, $ref);
 }
 
 sub msg_by_smsg ($$;$) {
@@ -324,15 +322,13 @@ sub msg_by_smsg ($$;$) {
        return unless defined $smsg;
        defined(my $blob = $smsg->{blob}) or return;
 
-       my $str = git($self)->cat_file($blob, $ref);
-       $$str =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s if $str;
-       $str;
+       git($self)->cat_file($blob, $ref);
 }
 
 sub smsg_mime {
        my ($self, $smsg, $ref) = @_;
        if (my $s = msg_by_smsg($self, $smsg, $ref)) {
-               $smsg->{mime} = PublicInbox::MIME->new($s);
+               $smsg->{mime} = PublicInbox::Eml->new($s);
                return $smsg;
        }
 }