1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 02:07:12 +00:00

Fixed saving unchanged drafts

This commit is contained in:
M66B 2020-02-13 12:10:12 +01:00
parent 8fbcbf38d4
commit 9303ba4978

View file

@ -3654,14 +3654,19 @@ public class FragmentCompose extends FragmentBase {
String p = Helper.readText(draft.getFile(context));
Document doc = JsoupEx.parse(p);
if ((body != null && !body.equals(doc.html())) ||
doc.select("div[fairemail=signature]").remove();
Elements ref = doc.select("div[fairemail=reference]");
ref.remove();
if (body == null)
body = Document.createShell("").html();
Document b = HtmlHelper.sanitize(context, body, true, false);
body = b.html();
if (!b.body().html().equals(doc.body().html()) ||
(extras != null && extras.containsKey("html"))) {
dirty = true;
doc.select("div[fairemail=signature]").remove();
Elements ref = doc.select("div[fairemail=reference]");
ref.remove();
boolean signature_end = prefs.getBoolean("signature_end", false);
// Get saved body
@ -3741,7 +3746,7 @@ public class FragmentCompose extends FragmentBase {
action == R.id.action_undo ||
action == R.id.action_redo ||
action == R.id.action_check) {
if (BuildConfig.DEBUG || dirty)
if (dirty)
EntityOperation.queue(context, draft, EntityOperation.ADD);
if (action == R.id.action_check) {