Auto map new folders

This commit is contained in:
M66B 2022-05-11 08:30:18 +02:00
parent a20d855354
commit ca401f27ea
1 changed files with 7 additions and 1 deletions

View File

@ -2529,12 +2529,18 @@ class Core {
if (sep > 0)
parent = db.folder().getFolderByName(account.id, fullName.substring(0, sep));
if (!EntityFolder.USER.equals(type) && !EntityFolder.SYSTEM.equals(type)) {
EntityFolder has = db.folder().getFolderByType(account.id, type);
if (has != null)
type = EntityFolder.USER;
}
folder = new EntityFolder();
folder.account = account.id;
folder.namespace = ifolder.first.getFullName();
folder.separator = separator;
folder.name = fullName;
folder.type = (EntityFolder.SYSTEM.equals(type) ? type : EntityFolder.USER);
folder.type = type;
folder.subscribed = subscribed;
folder.selectable = selectable;
folder.inferiors = inferiors;