Moved bodies up
This commit is contained in:
parent
0a53966b16
commit
922fa629ae
|
@ -159,11 +159,15 @@ open class EmailsFetcher(
|
|||
val email = Email(
|
||||
status.folder.getUID(message),
|
||||
sender, message.subject ?: "", map(message.sentDate ?: message.receivedDate),
|
||||
|
||||
message.getRecipients(Message.RecipientType.TO).orEmpty().map { map(it) }, message.getRecipients(Message.RecipientType.CC).orEmpty().map { map(it) }, message.getRecipients(Message.RecipientType.BCC).orEmpty().map { map(it) },
|
||||
(message.replyTo?.firstOrNull() as? InternetAddress)?.let { if (it.address != sender?.address) map(it) else null }, // only set replyTo if it differs from sender
|
||||
parts.any { it.mediaType == "application/pgp-encrypted" },
|
||||
imapMessage?.contentLanguage?.firstOrNull(),
|
||||
|
||||
plainTextBody, getHtmlBody(messageBodyParts, status, plainTextBody),
|
||||
|
||||
imapMessage?.contentLanguage?.firstOrNull(),
|
||||
parts.any { it.mediaType == "application/pgp-encrypted" },
|
||||
|
||||
attachments
|
||||
)
|
||||
|
||||
|
|
|
@ -24,11 +24,12 @@ class Email(
|
|||
val bcc: List<EmailAddress> = emptyList(),
|
||||
val replayTo: EmailAddress? = null,
|
||||
|
||||
val isEncrypted: Boolean = false,
|
||||
val contentLanguage: String? = null,
|
||||
val plainTextBody: String? = null,
|
||||
val htmlBody: String? = null,
|
||||
|
||||
val contentLanguage: String? = null,
|
||||
val isEncrypted: Boolean = false,
|
||||
|
||||
val attachments: List<EmailAttachment> = emptyList()
|
||||
) {
|
||||
val plainTextOrHtmlBody: String? by lazy { plainTextBody ?: htmlBody }
|
||||
|
|
Loading…
Reference in New Issue