Switching plain text / HTML is not possible for encrypted messages

pull/209/head
M66B 2 years ago
parent 07a0192b23
commit cde6c150e7

@ -5537,8 +5537,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
popupMenu.getMenu().findItem(R.id.menu_alternative) popupMenu.getMenu().findItem(R.id.menu_alternative)
.setTitle(message.isPlainOnly() .setTitle(message.isPlainOnly()
? R.string.title_alternative_html : R.string.title_alternative_text) ? R.string.title_alternative_html : R.string.title_alternative_text)
.setEnabled(message.uid != null && message.hasAlt()) .setEnabled(message.uid != null && message.hasAlt() && !message.isEncrypted())
.setVisible(message.accountProtocol == EntityAccount.TYPE_IMAP && !message.isEncrypted()); .setVisible(message.accountProtocol == EntityAccount.TYPE_IMAP);
popupMenu.insertIcons(context); popupMenu.insertIcons(context);

@ -8103,7 +8103,8 @@ public class FragmentMessages extends FragmentBase
String protect_subject = parts.getProtectedSubject(); String protect_subject = parts.getProtectedSubject();
// Write decrypted body // Write decrypted body
String html = parts.getHtml(context, false); boolean download_plain = prefs.getBoolean("download_plain", false);
String html = parts.getHtml(context, download_plain);
Helper.writeText(message.getFile(context), html); Helper.writeText(message.getFile(context), html);
Log.i("pgp html=" + (html == null ? null : html.length())); Log.i("pgp html=" + (html == null ? null : html.length()));
@ -8120,7 +8121,7 @@ public class FragmentMessages extends FragmentBase
db.message().setMessageContent(message.id, db.message().setMessageContent(message.id,
true, true,
message.language, message.language,
parts.isPlainOnly(false), parts.isPlainOnly(download_plain),
message.preview, message.preview,
message.warning); message.warning);
@ -8797,7 +8798,8 @@ public class FragmentMessages extends FragmentBase
// Write decrypted body // Write decrypted body
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String html = parts.getHtml(context, false); boolean download_plain = prefs.getBoolean("download_plain", false);
String html = parts.getHtml(context, download_plain);
Helper.writeText(message.getFile(context), html); Helper.writeText(message.getFile(context), html);
Log.i("s/mime html=" + (html == null ? null : html.length())); Log.i("s/mime html=" + (html == null ? null : html.length()));
@ -8812,7 +8814,7 @@ public class FragmentMessages extends FragmentBase
db.message().setMessageContent(message.id, db.message().setMessageContent(message.id,
true, true,
message.language, message.language,
parts.isPlainOnly(false), parts.isPlainOnly(download_plain),
message.preview, message.preview,
message.warning); message.warning);

Loading…
Cancel
Save