Default no download for archive, trash and junk

pull/147/head
M66B 6 years ago
parent 6dcac8ff91
commit 988973135d

@ -149,6 +149,13 @@ public class EntityFolder implements Serializable {
TRASH,
JUNK
);
static final List<Boolean> SYSTEM_FOLDER_DOWNLOAD = Arrays.asList(
true, // drafts
true, // sent
false, // archive
false, // trash
false // junk
); // MUST match SYSTEM_FOLDER_SYNC
public EntityFolder() {
}

@ -524,10 +524,12 @@ public class FragmentAccount extends FragmentEx {
DB db = DB.getInstance(context);
EntityFolder folder = db.folder().getFolderByName(id, ifolder.getFullName());
if (folder == null) {
int sync = EntityFolder.SYSTEM_FOLDER_SYNC.indexOf(type);
folder = new EntityFolder();
folder.name = ifolder.getFullName();
folder.type = (type == null ? EntityFolder.USER : type);
folder.synchronize = (type != null && EntityFolder.SYSTEM_FOLDER_SYNC.contains(type));
folder.synchronize = (sync >= 0);
folder.download = (sync < 0 ? true : EntityFolder.SYSTEM_FOLDER_DOWNLOAD.get(sync));
folder.sync_days = EntityFolder.DEFAULT_SYNC;
folder.keep_days = EntityFolder.DEFAULT_KEEP;
}

@ -338,11 +338,13 @@ public class FragmentSetup extends FragmentEx {
}
if (selectable && type != null) {
int sync = EntityFolder.SYSTEM_FOLDER_SYNC.indexOf(type);
EntityFolder folder = new EntityFolder();
folder.name = ifolder.getFullName();
folder.type = type;
folder.level = EntityFolder.getLevel(separator, folder.name);
folder.synchronize = EntityFolder.SYSTEM_FOLDER_SYNC.contains(type);
folder.synchronize = (sync >= 0);
folder.download = (sync < 0 ? true : EntityFolder.SYSTEM_FOLDER_DOWNLOAD.get(sync));
folder.sync_days = EntityFolder.DEFAULT_SYNC;
folder.keep_days = EntityFolder.DEFAULT_KEEP;
folders.add(folder);

Loading…
Cancel
Save