From 5eb7975899daecf70ed698068e42036d07ba8674 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 23 Oct 2019 15:29:22 +0200 Subject: [PATCH] Export/import account move to --- app/src/main/java/eu/faircode/email/ActivitySetup.java | 4 ++++ app/src/main/java/eu/faircode/email/EntityAccount.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/ActivitySetup.java b/app/src/main/java/eu/faircode/email/ActivitySetup.java index 6a46efb14a..9e41b3240d 100644 --- a/app/src/main/java/eu/faircode/email/ActivitySetup.java +++ b/app/src/main/java/eu/faircode/email/ActivitySetup.java @@ -751,10 +751,12 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac // Forward referenced Long swipe_left = account.swipe_left; Long swipe_right = account.swipe_right; + Long move_to = account.move_to; if (account.swipe_left != null && account.swipe_left > 0) account.swipe_left = null; if (account.swipe_right != null && account.swipe_right > 0) account.swipe_right = null; + account.move_to = null; account.created = new Date().getTime(); account.id = db.account().insertAccount(account); @@ -810,6 +812,8 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac account.swipe_left = folder.id; if (Objects.equals(swipe_right, id)) account.swipe_right = folder.id; + if (Objects.equals(move_to, id)) + account.move_to = folder.id; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (jfolder.has("channel")) { diff --git a/app/src/main/java/eu/faircode/email/EntityAccount.java b/app/src/main/java/eu/faircode/email/EntityAccount.java index 8fbda0f346..6a0190f429 100644 --- a/app/src/main/java/eu/faircode/email/EntityAccount.java +++ b/app/src/main/java/eu/faircode/email/EntityAccount.java @@ -180,6 +180,8 @@ public class EntityAccount extends EntityOrder implements Serializable { json.put("swipe_left", swipe_left); json.put("swipe_right", swipe_right); + json.put("move_to", move_to); + json.put("poll_interval", poll_interval); json.put("partial_fetch", partial_fetch); json.put("ignore_size", ignore_size); @@ -233,6 +235,9 @@ public class EntityAccount extends EntityOrder implements Serializable { if (json.has("swipe_right")) account.swipe_right = json.getLong("swipe_right"); + if (json.has("move_to")) + account.move_to = json.getLong("move_to"); + account.poll_interval = json.getInt("poll_interval"); account.partial_fetch = json.optBoolean("partial_fetch", true);