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

Commit 8835b1e4 authored by cketti's avatar cketti
Browse files

Extract subject when constructing MessageViewInfo for unencrypted emails

parent 6c66210e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -68,7 +68,8 @@ public class MessageViewInfoExtractor {
            if (cryptoAnnotations != null && !cryptoAnnotations.isEmpty()) {
                Timber.e("Got crypto message cryptoContentAnnotations but no crypto root part!");
            }
            return extractSimpleMessageForView(message, message);
            MessageViewInfo messageViewInfo = extractSimpleMessageForView(message, message);
            return messageViewInfo.withSubject(message.getSubject(), false);
        }

        boolean isOpenPgpEncrypted = (MessageCryptoStructureDetector.isPartMultipartEncrypted(cryptoContentPart) &&
+2 −0
Original line number Diff line number Diff line
@@ -379,6 +379,7 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest {
                bodypart("text/plain", "text"),
                attachmentPart
        ));
        message.setSubject(SUBJECT);
        AttachmentViewInfo attachmentViewInfo = mock(AttachmentViewInfo.class);
        setupAttachmentInfoForPart(attachmentPart, attachmentViewInfo);

@@ -391,6 +392,7 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest {
        assertSame(attachmentViewInfo, messageViewInfo.attachments.get(0));
        assertNull(messageViewInfo.cryptoResultAnnotation);
        assertTrue(messageViewInfo.extraAttachments.isEmpty());
        assertEquals(SUBJECT, messageViewInfo.subject);
    }

    @Test