From 08855c7b64c755351e781e3ef9ea97016314c73e Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 12 Oct 2023 20:09:35 +0200 Subject: [PATCH] Allow renaming inbox --- app/src/main/java/eu/faircode/email/Core.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 25ba87a413..30ea5f63ef 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -2738,20 +2738,19 @@ class Core { !EntityFolder.SYSTEM.equals(type)) { // Rename system folders - if (!EntityFolder.INBOX.equals(type)) - for (EntityFolder folder : new ArrayList<>(local.values())) - if (type.equals(folder.type) && - !fullName.equals(folder.name) && - !local.containsKey(fullName) && - !istore.getFolder(folder.name).exists()) { - Log.e(account.host + - " renaming " + type + " folder" + - " from " + folder.name + " to " + fullName); - local.remove(folder.name); - local.put(fullName, folder); - folder.name = fullName; - db.folder().setFolderName(folder.id, fullName); - } + for (EntityFolder folder : new ArrayList<>(local.values())) + if (type.equals(folder.type) && + !fullName.equals(folder.name) && + !local.containsKey(fullName) && + !istore.getFolder(folder.name).exists()) { + Log.e(account.host + + " renaming " + type + " folder" + + " from " + folder.name + " to " + fullName); + local.remove(folder.name); + local.put(fullName, folder); + folder.name = fullName; + db.folder().setFolderName(folder.id, fullName); + } // Reselect system folders once String key = "unset." + account.id + "." + type;