Removed special folder case

Some providers make all folders subfolder of the inbox
pull/147/head
M66B 6 years ago
parent 2b7c572ce2
commit 94eb9af995

@ -93,7 +93,6 @@ public class EntityFolder implements Serializable {
public String error;
static final String INBOX = "Inbox";
static final String INBOX_SUB = "Inbox_sub";
static final String OUTBOX = "Outbox";
static final String ARCHIVE = "All";
static final String DRAFTS = "Drafts";
@ -127,7 +126,6 @@ public class EntityFolder implements Serializable {
static final List<String> FOLDER_SORT_ORDER = Arrays.asList(
INBOX,
INBOX_SUB,
OUTBOX,
DRAFTS,
SENT,

@ -1949,10 +1949,6 @@ public class ServiceSynchronize extends LifecycleService {
}
}
// Special case
if (type == null && fullName.startsWith("INBOX" + separator))
type = EntityFolder.INBOX_SUB;
if (selectable) {
int level = EntityFolder.getLevel(separator, fullName);
EntityFolder folder = db.folder().getFolderByName(account.id, fullName);
@ -1971,8 +1967,9 @@ public class ServiceSynchronize extends LifecycleService {
} else {
Log.i(Helper.TAG, folder.name + " exists");
db.folder().setFolderLevel(folder.id, level);
if (EntityFolder.USER.equals(folder.type) &&
(EntityFolder.INBOX_SUB.equals(type) || EntityFolder.SYSTEM.equals(type)))
if ("Inbox_sub".equals(folder.type))
db.folder().setFolderType(folder.id, EntityFolder.USER);
else if (EntityFolder.USER.equals(folder.type) && EntityFolder.SYSTEM.equals(type))
db.folder().setFolderType(folder.id, type);
}
}

@ -221,7 +221,6 @@
<string name="title_folder_unified">Unified inbox</string>
<string name="title_folder_inbox">Inbox</string>
<string name="title_folder_inbox_sub">Inbox child</string>
<string name="title_folder_outbox">Outbox</string>
<string name="title_folder_all">Archive</string>
<string name="title_folder_drafts">Drafts</string>

Loading…
Cancel
Save