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

Commit fa998981 authored by Vincent Breitmoser's avatar Vincent Breitmoser Committed by cketti
Browse files

add handling for LocalMessage parts to AttachmentInfoExtractor

parent e03df3d9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ public class LocalMessage extends MimeMessage {
        mimeType = cursor.getString(23);
    }

    long getMessagePartId() {
    public long getMessagePartId() {
        return messagePartId;
    }

+8 −1
Original line number Diff line number Diff line
@@ -21,8 +21,9 @@ import com.fsck.k9.mail.Part;
import com.fsck.k9.mail.internet.MimeHeader;
import com.fsck.k9.mail.internet.MimeUtility;
import com.fsck.k9.mailstore.AttachmentViewInfo;
import com.fsck.k9.mailstore.LocalPart;
import com.fsck.k9.mailstore.DeferredFileBody;
import com.fsck.k9.mailstore.LocalMessage;
import com.fsck.k9.mailstore.LocalPart;
import com.fsck.k9.provider.AttachmentProvider;
import com.fsck.k9.provider.DecryptedFileProvider;

@@ -66,6 +67,12 @@ public class AttachmentInfoExtractor {
            long messagePartId = localPart.getId();
            size = localPart.getSize();
            uri = AttachmentProvider.getAttachmentUri(accountUuid, messagePartId);
        } else if (part instanceof LocalMessage) {
            LocalMessage localMessage = (LocalMessage) part;
            String accountUuid = localMessage.getAccount().getUuid();
            long messagePartId = localMessage.getMessagePartId();
            size = localMessage.getSize();
            uri = AttachmentProvider.getAttachmentUri(accountUuid, messagePartId);
        } else {
            Body body = part.getBody();
            if (body instanceof DeferredFileBody) {