|
|
@ -81,7 +81,6 @@ import java.util.Objects;
|
|
|
|
import java.util.Properties;
|
|
|
|
import java.util.Properties;
|
|
|
|
import java.util.concurrent.Semaphore;
|
|
|
|
import java.util.concurrent.Semaphore;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.mail.Address;
|
|
|
|
import javax.mail.Address;
|
|
|
|
import javax.mail.FetchProfile;
|
|
|
|
import javax.mail.FetchProfile;
|
|
|
@ -1015,10 +1014,9 @@ class Core {
|
|
|
|
Map<String, List<EntityFolder>> parentFolders = new HashMap<>();
|
|
|
|
Map<String, List<EntityFolder>> parentFolders = new HashMap<>();
|
|
|
|
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)));
|
|
|
|
|
|
|
|
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 subscribed = subscription.contains(fullName);
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
@ -1052,6 +1050,9 @@ 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.selectable != selectable)
|
|
|
|
|
|
|
|
db.folder().setFolderSelectable(folder.id, selectable);
|
|
|
|
|
|
|
|
|
|
|
|
// 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);
|
|
|
|