Quick setup alt fix

This commit is contained in:
M66B 2019-07-15 19:05:55 +02:00
parent 667e25b7dd
commit fe41220b42
1 changed files with 9 additions and 11 deletions

View File

@ -249,25 +249,24 @@ public class FragmentQuickSetup extends FragmentBase {
String fullName = ifolder.getFullName(); String fullName = ifolder.getFullName();
String[] attrs = ((IMAPFolder) ifolder).getAttributes(); String[] attrs = ((IMAPFolder) ifolder).getAttributes();
String type = EntityFolder.getType(attrs, fullName, true); String type = EntityFolder.getType(attrs, fullName, true);
boolean alt = fullName.toLowerCase().contains("draft");
Log.i(fullName + " attrs=" + TextUtils.join(" ", attrs) + " type=" + type); Log.i(fullName +
" attrs=" + TextUtils.join(" ", attrs) +
boolean isAltDrafts = fullName.toLowerCase().contains("draft"); " type=" + type + " alt=" + altDrafts);
if (type != null && (!EntityFolder.USER.equals(type) || isAltDrafts)) {
if (isAltDrafts)
type = EntityFolder.DRAFTS;
if (type != null && (!EntityFolder.USER.equals(type) || alt)) {
int sync = EntityFolder.SYSTEM_FOLDER_SYNC.indexOf(type); int sync = EntityFolder.SYSTEM_FOLDER_SYNC.indexOf(type);
EntityFolder folder = new EntityFolder(); EntityFolder folder = new EntityFolder();
folder.name = fullName; folder.name = fullName;
folder.type = type; folder.type = (alt ? EntityFolder.DRAFTS : type);
folder.synchronize = (sync >= 0); folder.synchronize = (sync >= 0);
folder.download = (sync < 0 ? true : EntityFolder.SYSTEM_FOLDER_DOWNLOAD.get(sync)); folder.download = (sync < 0 ? true : EntityFolder.SYSTEM_FOLDER_DOWNLOAD.get(sync));
folder.sync_days = EntityFolder.DEFAULT_SYNC; folder.sync_days = EntityFolder.DEFAULT_SYNC;
folder.keep_days = EntityFolder.DEFAULT_KEEP; folder.keep_days = EntityFolder.DEFAULT_KEEP;
if (isAltDrafts) if (alt)
altDrafts = folder; altDrafts = folder;
else else
folders.add(folder); folders.add(folder);
@ -276,8 +275,7 @@ public class FragmentQuickSetup extends FragmentBase {
folder.unified = true; folder.unified = true;
folder.notify = true; folder.notify = true;
inbox = true; inbox = true;
} } else if (EntityFolder.DRAFTS.equals(type))
if (EntityFolder.DRAFTS.equals(type))
drafts = true; drafts = true;
} }
} }