Prepare message keywords/categories support

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2021 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2012-09-13 21:58:20 +00:00
parent 4f0ee846fe
commit c5a7918843
2 changed files with 12 additions and 0 deletions

View File

@ -788,6 +788,7 @@ public abstract class ExchangeSession {
IMAP_MESSAGE_ATTRIBUTES.add("lastmodified");
// OSX IMAP requests content-class
IMAP_MESSAGE_ATTRIBUTES.add("contentclass");
IMAP_MESSAGE_ATTRIBUTES.add("keywords");
}
protected static final Set<String> UID_MESSAGE_ATTRIBUTES = new HashSet<String>();
@ -1695,6 +1696,10 @@ public abstract class ExchangeSession {
* Message content class.
*/
public String contentClass;
/**
* Message keywords (categories).
*/
public String keywords;
/**
* Message IMAP uid, unique in folder (x0e230003).
*/
@ -1817,6 +1822,11 @@ public abstract class ExchangeSession {
if (forwarded) {
buffer.append("$Forwarded ");
}
if (keywords != null) {
for (String keyword:keywords.split(",")) {
buffer.append(keyword).append(" ");
}
}
return buffer.toString().trim();
}

View File

@ -2010,6 +2010,8 @@ public class DavExchangeSession extends ExchangeSession {
String lastmodified = convertDateFromExchange(getPropertyIfExists(properties, "lastmodified"));
message.recent = !message.read && lastmodified != null && lastmodified.equals(message.date);
message.keywords = getPropertyIfExists(properties, "keywords");
if (LOGGER.isDebugEnabled()) {
StringBuilder buffer = new StringBuilder();
buffer.append("Message");