|
|
@ -902,16 +902,12 @@ class Core {
|
|
|
|
for (Folder ifolder : ifolders) {
|
|
|
|
for (Folder ifolder : ifolders) {
|
|
|
|
String fullName = ifolder.getFullName();
|
|
|
|
String fullName = ifolder.getFullName();
|
|
|
|
String[] name = fullName.split(Pattern.quote(Character.toString(separator)));
|
|
|
|
String[] name = fullName.split(Pattern.quote(Character.toString(separator)));
|
|
|
|
String childName = name[name.length - 1];
|
|
|
|
|
|
|
|
boolean subscribed = subscription.contains(fullName);
|
|
|
|
boolean subscribed = subscription.contains(fullName);
|
|
|
|
String[] attr = ((IMAPFolder) ifolder).getAttributes();
|
|
|
|
String[] attr = ((IMAPFolder) ifolder).getAttributes();
|
|
|
|
String type = EntityFolder.getType(attr, fullName, false);
|
|
|
|
String type = EntityFolder.getType(attr, fullName, false);
|
|
|
|
boolean selectable = !Arrays.asList(attr).contains("\\Noselect") &&
|
|
|
|
boolean selectable = !Arrays.asList(attr).contains("\\Noselect") &&
|
|
|
|
((ifolder.getType() & IMAPFolder.HOLDS_MESSAGES) != 0);
|
|
|
|
((ifolder.getType() & IMAPFolder.HOLDS_MESSAGES) != 0);
|
|
|
|
|
|
|
|
|
|
|
|
if (EntityFolder.INBOX.equals(type) || fullName.equals(childName))
|
|
|
|
|
|
|
|
childName = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Log.i(account.name + ":" + fullName + " subscribed=" + subscribed +
|
|
|
|
Log.i(account.name + ":" + fullName + " subscribed=" + subscribed +
|
|
|
|
" type=" + type + " attrs=" + TextUtils.join(" ", attr));
|
|
|
|
" type=" + type + " attrs=" + TextUtils.join(" ", attr));
|
|
|
|
|
|
|
|
|
|
|
@ -927,7 +923,6 @@ class Core {
|
|
|
|
folder = new EntityFolder();
|
|
|
|
folder = new EntityFolder();
|
|
|
|
folder.account = account.id;
|
|
|
|
folder.account = account.id;
|
|
|
|
folder.name = fullName;
|
|
|
|
folder.name = fullName;
|
|
|
|
folder.display = childName;
|
|
|
|
|
|
|
|
folder.type = (EntityFolder.SYSTEM.equals(type) ? type : EntityFolder.USER);
|
|
|
|
folder.type = (EntityFolder.SYSTEM.equals(type) ? type : EntityFolder.USER);
|
|
|
|
folder.synchronize = false;
|
|
|
|
folder.synchronize = false;
|
|
|
|
folder.subscribed = subscribed;
|
|
|
|
folder.subscribed = subscribed;
|
|
|
@ -943,9 +938,6 @@ class Core {
|
|
|
|
if (folder.subscribed == null || !folder.subscribed.equals(subscribed))
|
|
|
|
if (folder.subscribed == null || !folder.subscribed.equals(subscribed))
|
|
|
|
db.folder().setFolderSubscribed(folder.id, subscribed);
|
|
|
|
db.folder().setFolderSubscribed(folder.id, subscribed);
|
|
|
|
|
|
|
|
|
|
|
|
if (folder.display == null && childName != null)
|
|
|
|
|
|
|
|
db.folder().setFolderDisplay(folder.id, childName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Compatibility
|
|
|
|
// Compatibility
|
|
|
|
if (EntityFolder.USER.equals(folder.type) && EntityFolder.SYSTEM.equals(type))
|
|
|
|
if (EntityFolder.USER.equals(folder.type) && EntityFolder.SYSTEM.equals(type))
|
|
|
|
db.folder().setFolderType(folder.id, type);
|
|
|
|
db.folder().setFolderType(folder.id, type);
|
|
|
|