1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 00:58:50 -05:00

Display decrypted/verified messages like text/plain messages

Nicely format the text instead of wrapping it in <pre> tags.
This commit is contained in:
cketti 2012-08-27 17:38:10 +02:00
parent 76f741f11f
commit c0153a1636

View File

@ -38,6 +38,7 @@ import com.fsck.k9.crypto.CryptoProvider;
import com.fsck.k9.crypto.PgpData; import com.fsck.k9.crypto.PgpData;
import com.fsck.k9.helper.ClipboardManager; import com.fsck.k9.helper.ClipboardManager;
import com.fsck.k9.helper.Contacts; import com.fsck.k9.helper.Contacts;
import com.fsck.k9.helper.HtmlConverter;
import com.fsck.k9.helper.Utility; import com.fsck.k9.helper.Utility;
import com.fsck.k9.mail.*; import com.fsck.k9.mail.*;
import com.fsck.k9.mail.internet.MimeUtility; import com.fsck.k9.mail.internet.MimeUtility;
@ -533,11 +534,12 @@ public class SingleMessageView extends LinearLayout implements OnClickListener,
String text = null; String text = null;
if (pgpData != null) { if (pgpData != null) {
text = pgpData.getDecryptedData(); text = pgpData.getDecryptedData();
if (text != null) {
text = HtmlConverter.textToHtml(text, true);
}
} }
if (text != null) {
text = "<html><body><pre>" + text + "</pre></body></html>"; if (text == null) {
} else {
// getTextForDisplay() always returns HTML-ified content.
text = message.getTextForDisplay(); text = message.getTextForDisplay();
} }