Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af9a5d2f authored by cketti's avatar cketti Committed by GitHub
Browse files

Merge pull request #1392 from k9mail/extract-attachment-presenter

Extract AttachmentPresenter from MessageCompose
parents 7ebf79cd 4d3bc41c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ public interface Part {

    String getContentType();

    String getDisposition() throws MessagingException;
    String getDisposition();

    String getContentId();

+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ class DecoderUtil {

        // ANDROID:  Most strings will not include "=?" so a quick test can prevent unneeded
        // object creation.  This could also be handled via lazy creation of the StringBuilder.
        if (body.indexOf("=?") == -1) {
        if (!body.contains("=?")) {
            return body;
        }

+4 −6
Original line number Diff line number Diff line
@@ -440,12 +440,10 @@ public class MessageExtractor {
    }

    private static String getContentDisposition(Part part) {
        try {
        String disposition = part.getDisposition();
        if (disposition != null) {
            return MimeUtility.getHeaderParameter(disposition, null);
        }
        } catch (MessagingException e) { /* ignore */ }
        return null;
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -92,11 +92,11 @@ public class MimeBodyPart extends BodyPart {
    @Override
    public String getContentType() {
        String contentType = getFirstHeader(MimeHeader.HEADER_CONTENT_TYPE);
        return (contentType == null) ? "text/plain" : contentType;
        return (contentType == null) ? "text/plain" : MimeUtility.unfoldAndDecode(contentType);
    }

    @Override
    public String getDisposition() throws MessagingException {
    public String getDisposition() {
        return getFirstHeader(MimeHeader.HEADER_CONTENT_DISPOSITION);
    }

+3 −3
Original line number Diff line number Diff line
@@ -164,12 +164,12 @@ public class MimeMessage extends Message {
    @Override
    public String getContentType() {
        String contentType = getFirstHeader(MimeHeader.HEADER_CONTENT_TYPE);
        return (contentType == null) ? "text/plain" : contentType;
        return (contentType == null) ? "text/plain" : MimeUtility.unfoldAndDecode(contentType);
    }

    @Override
    public String getDisposition() throws MessagingException {
        return getFirstHeader(MimeHeader.HEADER_CONTENT_DISPOSITION);
    public String getDisposition() {
        return MimeUtility.unfoldAndDecode(getFirstHeader(MimeHeader.HEADER_CONTENT_DISPOSITION));
    }

    @Override
Loading