mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-05 18:58:02 -05:00
IMAP: retrieve message count on folder
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2027 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
cdfad5a8ba
commit
da71c7002d
@ -1524,6 +1524,10 @@ public abstract class ExchangeSession {
|
||||
* Folder class (PR_CONTAINER_CLASS).
|
||||
*/
|
||||
public String folderClass;
|
||||
/**
|
||||
* Folder message count.
|
||||
*/
|
||||
public int count;
|
||||
/**
|
||||
* Folder unread message count.
|
||||
*/
|
||||
|
@ -1715,7 +1715,10 @@ public class DavExchangeSession extends ExchangeSession {
|
||||
folder.folderClass = getPropertyIfExists(properties, "folderclass");
|
||||
folder.hasChildren = "1".equals(getPropertyIfExists(properties, "hassubs"));
|
||||
folder.noInferiors = "1".equals(getPropertyIfExists(properties, "nosubs"));
|
||||
folder.count = getIntPropertyIfExists(properties, "count");
|
||||
folder.unreadCount = getIntPropertyIfExists(properties, "unreadcount");
|
||||
// fake recent value
|
||||
folder.recent = folder.unreadCount;
|
||||
folder.ctag = getPropertyIfExists(properties, "contenttag");
|
||||
folder.etag = getPropertyIfExists(properties, "lastmodified");
|
||||
|
||||
@ -1764,6 +1767,7 @@ public class DavExchangeSession extends ExchangeSession {
|
||||
FOLDER_PROPERTIES.add("folderclass");
|
||||
FOLDER_PROPERTIES.add("hassubs");
|
||||
FOLDER_PROPERTIES.add("nosubs");
|
||||
FOLDER_PROPERTIES.add("count");
|
||||
FOLDER_PROPERTIES.add("unreadcount");
|
||||
FOLDER_PROPERTIES.add("contenttag");
|
||||
FOLDER_PROPERTIES.add("lastmodified");
|
||||
|
@ -106,6 +106,7 @@ public class Field {
|
||||
createField("folderclass", SCHEMAS_EXCHANGE, "outlookfolderclass");
|
||||
createField(DAV, "hassubs");
|
||||
createField(DAV, "nosubs");
|
||||
createField("count", DAV, "objectcount");
|
||||
createField(URN_SCHEMAS_HTTPMAIL, "unreadcount");
|
||||
createField(SCHEMAS_REPL, "contenttag");
|
||||
|
||||
|
@ -938,6 +938,7 @@ public class EwsExchangeSession extends ExchangeSession {
|
||||
FOLDER_PROPERTIES.add(Field.get("lastmodified"));
|
||||
FOLDER_PROPERTIES.add(Field.get("folderclass"));
|
||||
FOLDER_PROPERTIES.add(Field.get("ctag"));
|
||||
FOLDER_PROPERTIES.add(Field.get("count"));
|
||||
FOLDER_PROPERTIES.add(Field.get("unread"));
|
||||
FOLDER_PROPERTIES.add(Field.get("hassubs"));
|
||||
FOLDER_PROPERTIES.add(Field.get("uidNext"));
|
||||
@ -951,7 +952,10 @@ public class EwsExchangeSession extends ExchangeSession {
|
||||
folder.folderClass = item.get(Field.get("folderclass").getResponseName());
|
||||
folder.etag = item.get(Field.get("lastmodified").getResponseName());
|
||||
folder.ctag = item.get(Field.get("ctag").getResponseName());
|
||||
folder.count = item.getInt(Field.get("count").getResponseName());
|
||||
folder.unreadCount = item.getInt(Field.get("unread").getResponseName());
|
||||
// fake recent value
|
||||
folder.recent = folder.unreadCount;
|
||||
folder.hasChildren = item.getBoolean(Field.get("hassubs").getResponseName());
|
||||
// noInferiors not implemented
|
||||
folder.uidNext = item.getInt(Field.get("uidNext").getResponseName());
|
||||
|
@ -40,7 +40,9 @@ public final class Field {
|
||||
|
||||
// folder
|
||||
FIELD_MAP.put("ctag", new ExtendedFieldURI(0x670a, ExtendedFieldURI.PropertyType.SystemTime)); // PR_LOCAL_COMMIT_TIME_MAX
|
||||
FIELD_MAP.put("count", new ExtendedFieldURI(0x3602, ExtendedFieldURI.PropertyType.Integer)); // PR_CONTENT_COUNT
|
||||
FIELD_MAP.put("unread", new ExtendedFieldURI(0x3603, ExtendedFieldURI.PropertyType.Integer)); // PR_CONTENT_UNREAD
|
||||
|
||||
FIELD_MAP.put("hassubs", new ExtendedFieldURI(0x360a, ExtendedFieldURI.PropertyType.Boolean)); // PR_SUBFOLDERS
|
||||
FIELD_MAP.put("folderDisplayName", new UnindexedFieldURI("folder:DisplayName"));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user