Added folder subtype flagged

This commit is contained in:
M66B
2023-01-18 20:54:42 +01:00
parent 41e9935c88
commit cbebeb29d2
6 changed files with 2877 additions and 4 deletions

View File

@@ -78,6 +78,7 @@ public class EntityFolder extends EntityOrder implements Serializable {
@NonNull
public String type;
public String inherited_type;
public String subtype;
@NonNull
public Integer level = 0; // obsolete
@NonNull
@@ -157,6 +158,8 @@ public class EntityFolder extends EntityOrder implements Serializable {
static final String SYSTEM = "System";
static final String USER = "User";
static final String FLAGGED = "flagged";
// https://tools.ietf.org/html/rfc6154
// https://www.iana.org/assignments/imap-mailbox-name-attributes/imap-mailbox-name-attributes.xhtml
private static final List<String> SYSTEM_FOLDER_ATTR = Collections.unmodifiableList(Arrays.asList(
@@ -507,6 +510,13 @@ public class EntityFolder extends EntityOrder implements Serializable {
return USER;
}
static String getSubtype(String[] attrs, String fullname) {
for (String attr : attrs)
if ("\\Flagged".equals(attr)) // Gmail
return FLAGGED;
return null;
}
private static class TypeScore {
@NonNull
private String type;