diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index 073f5c065..7ecd59f1e 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -1978,8 +1978,7 @@ public class MessageView extends K9Activity implements OnClickListener } MessageView.this.mMessage = message; mHandler.removeAllAttachments(); - String text; - String type = "text/html"; + String text, type; if (mPgpData.getDecryptedData() != null) { text = mPgpData.getDecryptedData(); @@ -1987,11 +1986,14 @@ public class MessageView extends K9Activity implements OnClickListener } else { + // getTextForDisplay() always returns HTML-ified content. text = ((LocalMessage)mMessage).getTextForDisplay(); + type = "text/html"; } if (text != null) { final String emailText = text; + final String contentType = type; mHandler.post(new Runnable() { public void run() @@ -2000,12 +2002,12 @@ public class MessageView extends K9Activity implements OnClickListener if (mScreenReaderEnabled) { mAccessibleMessageContentView.loadDataWithBaseURL("http://", - emailText, "text/html", "utf-8", null); + emailText, contentType, "utf-8", null); } else { mMessageContentView.loadDataWithBaseURL("http://", emailText, - "text/html", "utf-8", null); + contentType, "utf-8", null); mMessageContentView.scrollTo(0, 0); } updateDecryptLayout(); diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java index 375d3637f..9b21140c6 100644 --- a/src/com/fsck/k9/mail/store/LocalStore.java +++ b/src/com/fsck/k9/mail/store/LocalStore.java @@ -5305,6 +5305,9 @@ public class LocalStore extends Store implements Serializable public static class LocalTextBody extends TextBody { + /** + * This is an HTML-ified version of the message for display purposes. + */ private String mBodyForDisplay; public LocalTextBody(String body) @@ -5412,11 +5415,15 @@ public class LocalStore extends Store implements Serializable } } - - - public String getTextForDisplay() throws MessagingException + /** + * Fetch the message text for display. This always returns an HTML-ified version of the + * message, even if it was originally a text-only message. + * @return HTML version of message for display purposes. + * @throws MessagingException + */ + public String getTextForDisplay() throws MessagingException { - String text;// First try and fetch an HTML part. + String text; // First try and fetch an HTML part. Part part = MimeUtility.findFirstPartByMimeType(this, "text/html"); if (part == null) {