From 356bfa01fcc55cf56f0e10efecb56622de140639 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 22 Nov 2019 19:23:37 +0100 Subject: [PATCH] Ensure revision number --- .../java/eu/faircode/email/FragmentCompose.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index afc6fdd954..0b537906e5 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -2548,15 +2548,14 @@ public class FragmentCompose extends FragmentBase { if (data.draft.encrypt == null || !data.draft.encrypt) EntityOperation.queue(context, data.draft, EntityOperation.ADD); } else { + if (data.draft.revision == null) { + data.draft.revision = 1; + data.draft.revisions = 1; + db.message().setMessageRevision(data.draft.id, data.draft.revision); + db.message().setMessageRevisions(data.draft.id, data.draft.revisions); + } + if (data.draft.content) { - - if (data.draft.revision == null) { - data.draft.revision = 1; - data.draft.revisions = 1; - db.message().setMessageRevision(data.draft.id, data.draft.revision); - db.message().setMessageRevisions(data.draft.id, data.draft.revisions); - } - File file = data.draft.getFile(context); Document doc = JsoupEx.parse(Helper.readText(file));