]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwAttach.pm
wwwstream: reduce blob fetch paths for ->getline
[public-inbox.git] / lib / PublicInbox / WwwAttach.pm
index 5b2914b393fdcc28ea3d220eeac3137004ae3b8d..7e8496d7ab9c59c4a55670860d2255b02e7d7289 100644 (file)
@@ -6,7 +6,7 @@ package PublicInbox::WwwAttach; # internal package
 use strict;
 use warnings;
 use bytes (); # only for bytes::length
-use Email::MIME::ContentType qw(parse_content_type);
+use PublicInbox::EmlContentFoo qw(parse_content_type);
 use PublicInbox::Eml;
 
 sub get_attach_i { # ->each_part callback
@@ -17,8 +17,7 @@ sub get_attach_i { # ->each_part callback
        my $ct = $part->content_type;
        $ct = parse_content_type($ct) if $ct;
 
-       # discrete == type, we remain Debian wheezy-compatible
-       if ($ct && (($ct->{discrete} || '') eq 'text')) {
+       if ($ct && (($ct->{type} || '') eq 'text')) {
                # display all text as text/plain:
                my $cset = $ct->{attributes}->{charset};
                if ($cset && ($cset =~ /\A[a-zA-Z0-9_\-]+\z/)) {