From 74016592ac71780b81299b519a6f7aa12dffaa85 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 7 Jul 2019 22:53:52 +0200 Subject: [PATCH] Prefer first text/html part --- .../main/java/eu/faircode/email/MessageHelper.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index 2dc722b197..ada72edd49 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -1038,10 +1038,13 @@ public class MessageHelper { TextUtils.isEmpty(filename) && ((parts.plain == null && part.isMimeType("text/plain")) || (parts.html == null && part.isMimeType("text/html")))) { - if (part.isMimeType("text/plain")) - parts.plain = part; - else - parts.html = part; + if (part.isMimeType("text/plain")) { + if (parts.plain == null) + parts.plain = part; + } else { + if (parts.html == null) + parts.html = part; + } } else { AttachmentPart apart = new AttachmentPart(); apart.disposition = disposition;