]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Import.pm
remove most internal Email::MIME usage
[public-inbox.git] / lib / PublicInbox / Import.pm
index 95d654f667221711de6897ffd632b197bd6d10cf..07d1859920003ea820c8ccd70cb536acee9e2f74 100644 (file)
@@ -15,6 +15,7 @@ use PublicInbox::Address;
 use PublicInbox::MsgTime qw(msg_timestamp msg_datestamp);
 use PublicInbox::ContentId qw(content_digest);
 use PublicInbox::MDA;
+use PublicInbox::Eml;
 use POSIX qw(strftime);
 
 sub new {
@@ -137,7 +138,7 @@ sub check_remove_v1 {
        $info =~ m!\A100644 blob ([a-f0-9]{40})\t!s or die "not blob: $info";
        my $oid = $1;
        my $msg = _cat_blob($r, $w, $oid) or die "BUG: cat-blob $1 failed";
-       my $cur = PublicInbox::MIME->new($msg);
+       my $cur = PublicInbox::Eml->new($msg);
        my $cur_s = $cur->header('Subject');
        $cur_s = '' unless defined $cur_s;
        my $cur_m = $mime->header('Subject');
@@ -212,13 +213,13 @@ sub get_mark {
 }
 
 # returns undef on non-existent
-# ('MISMATCH', Email::MIME) on mismatch
-# (:MARK, Email::MIME) on success
+# ('MISMATCH', PublicInbox::Eml) on mismatch
+# (:MARK, PublicInbox::Eml) on success
 #
 # v2 callers should check with Xapian before calling this as
 # it is not idempotent.
 sub remove {
-       my ($self, $mime, $msg) = @_; # mime = Email::MIME
+       my ($self, $mime, $msg) = @_; # mime = PublicInbox::Eml or Email::MIME
 
        my $path_type = $self->{path_type};
        my ($path, $err, $cur, $blob);
@@ -354,7 +355,7 @@ sub v1_mid0 ($) {
        my $hdr = $mime->header_obj;
        my $mids = mids($hdr);
 
-       if (!scalar(@$mids)) { # spam often has no Message-Id
+       if (!scalar(@$mids)) { # spam often has no Message-ID
                my $mid0 = digest2mid(content_digest($mime), $hdr);
                append_mid($hdr, $mid0);
                return $mid0;
@@ -374,7 +375,7 @@ sub clean_tree_v2 ($$$) {
 # returns undef on duplicate
 # returns the :MARK of the most recent commit
 sub add {
-       my ($self, $mime, $check_cb, $smsg) = @_; # mime = Email::MIME
+       my ($self, $mime, $check_cb, $smsg) = @_;
 
        my ($name, $email, $at, $ct, $subject) = extract_cmt_info($mime, $smsg);
        my $path_type = $self->{path_type};