From bff042ae91961a4d33133ad5a05dfd04278fb803 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 23 Dec 2018 15:51:40 +0000 Subject: [PATCH] Fixed recognizing inbox --- .../main/java/eu/faircode/email/ServiceSynchronize.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 07616da82c..5123622b5c 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1935,7 +1935,8 @@ public class ServiceSynchronize extends LifecycleService { String type = null; boolean selectable = true; String[] attrs = ((IMAPFolder) ifolder).getAttributes(); - Log.i(Helper.TAG, fullName + " attrs=" + TextUtils.join(" ", attrs)); + Log.i(Helper.TAG, account.name + ":" + fullName + + " attrs=" + TextUtils.join(" ", attrs)); for (String attr : attrs) { if ("\\Noselect".equals(attr) || "\\NonExistent".equals(attr)) selectable = false; @@ -1949,6 +1950,9 @@ public class ServiceSynchronize extends LifecycleService { } } + if ("INBOX".equals(fullName.toUpperCase())) + type = EntityFolder.INBOX; + if (selectable) { names.remove(fullName); @@ -1986,7 +1990,8 @@ public class ServiceSynchronize extends LifecycleService { if ("Inbox_sub".equals(folder.type)) db.folder().setFolderType(folder.id, EntityFolder.USER); - else if (EntityFolder.USER.equals(folder.type) && EntityFolder.SYSTEM.equals(type)) + else if (EntityFolder.USER.equals(folder.type) && + type != null && !EntityFolder.USER.equals(type)) db.folder().setFolderType(folder.id, type); } }