Allow renaming inbox

This commit is contained in:
M66B 2023-10-12 20:09:35 +02:00
parent f6af86c629
commit 08855c7b64
1 changed files with 13 additions and 14 deletions

View File

@ -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;