From 7c09844f9df8a14ee97989046fabf6c459b37461 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 2 Jul 2022 08:37:27 +0200 Subject: [PATCH] Quick move single account --- .../main/java/eu/faircode/email/FragmentMessages.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index ed165a4f37..ee97afa4c0 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -1431,10 +1431,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. if (result == null) return; - if (result.accounts.size() == 1) { - for (EntityAccount account : result.accounts.keySet()) - onActionMoveSelectionAccount(account.id, false, result.folders); - } else { + if (result.account != null) + onActionMoveSelectionAccount(result.account.id, false, result.folders); + else { PopupMenuLifecycle popupMenu = new PopupMenuLifecycle(v.getContext(), getViewLifecycleOwner(), ibMove); int order = 0; @@ -9849,6 +9848,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. Boolean leave_deleted; boolean read_only; List folders; + EntityAccount account; Map accounts; EntityAccount copyto; @@ -10033,6 +10033,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. if (result.hasTrash == null) result.hasTrash = false; if (result.hasJunk == null) result.hasJunk = false; + if (!result.hasPop && accounts.size() == 1) + result.account = accounts.values().iterator().next(); + result.accounts = new LinkedHashMap<>(); if (!result.hasPop) { List syncing = db.account().getSynchronizingAccounts(EntityAccount.TYPE_IMAP);