From 6f0505337497156b5fc46a94a228fa7f67cfecfe Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 6 May 2019 07:37:02 +0200 Subject: [PATCH] Convert to plain text only on reference edit --- app/src/main/java/eu/faircode/email/DaoMessage.java | 3 +++ app/src/main/java/eu/faircode/email/FragmentCompose.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/DaoMessage.java b/app/src/main/java/eu/faircode/email/DaoMessage.java index 54960fb691..093e278e1e 100644 --- a/app/src/main/java/eu/faircode/email/DaoMessage.java +++ b/app/src/main/java/eu/faircode/email/DaoMessage.java @@ -385,6 +385,9 @@ public interface DaoMessage { @Query("UPDATE message SET stored = :stored WHERE id = :id") int setMessageStored(long id, long stored); + @Query("UPDATE message SET plain_only = :plain_only WHERE id = :id") + int setMessagePlainOnly(long id, boolean plain_only); + @Query("UPDATE message SET last_attempt = :last_attempt WHERE id = :id") int setMessageLastAttempt(long id, long last_attempt); diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 13b9f866e8..d1754be8f1 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -581,11 +581,15 @@ public class FragmentCompose extends FragmentBase { refFile.delete(); + db.message().setMessagePlainOnly(draft.id, true); + return null; } @Override protected void onExecuted(Bundle args, Void data) { + plain_only = true; + getActivity().invalidateOptionsMenu(); showDraft(working); }