From c4bf7f91cafe4695c62d627b1e38c2aef8cc3eb6 Mon Sep 17 00:00:00 2001 From: dankito Date: Thu, 21 Nov 2024 21:51:20 +0100 Subject: [PATCH] Added isEncrypted --- .../src/main/kotlin/net/codinux/invoicing/mail/MailReader.kt | 1 + .../main/kotlin/net/codinux/invoicing/mail/MailWithInvoice.kt | 1 + 2 files changed, 2 insertions(+) diff --git a/e-invoicing-domain/src/main/kotlin/net/codinux/invoicing/mail/MailReader.kt b/e-invoicing-domain/src/main/kotlin/net/codinux/invoicing/mail/MailReader.kt index d4012a9..8237be3 100644 --- a/e-invoicing-domain/src/main/kotlin/net/codinux/invoicing/mail/MailReader.kt +++ b/e-invoicing-domain/src/main/kotlin/net/codinux/invoicing/mail/MailReader.kt @@ -111,6 +111,7 @@ class MailReader( return MailWithInvoice( message.from?.joinToString(), message.subject ?: "", message.sentDate?.let { map(it) }, map(message.receivedDate), message.messageNumber, + parts.any { it.mediaType == "application/pgp-encrypted" }, getPlainTextBody(parts), getHtmlBody(parts), attachmentsWithEInvoice ) diff --git a/e-invoicing-domain/src/main/kotlin/net/codinux/invoicing/mail/MailWithInvoice.kt b/e-invoicing-domain/src/main/kotlin/net/codinux/invoicing/mail/MailWithInvoice.kt index f74781c..6c85a64 100644 --- a/e-invoicing-domain/src/main/kotlin/net/codinux/invoicing/mail/MailWithInvoice.kt +++ b/e-invoicing-domain/src/main/kotlin/net/codinux/invoicing/mail/MailWithInvoice.kt @@ -16,6 +16,7 @@ class MailWithInvoice( * -> use with care. Message numbers are not valid / the same anymore after expunge. */ val messageNumber: Int, + val isEncrypted: Boolean = false, val plainTextBody: String?, val htmlBody: String?, val attachmentsWithEInvoice: List