Caldav: from John Ahern: translate CLASS and iCal X-CALENDARSERVER-ACCESS values
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@376 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
fee03f5917
commit
8dd6018aaf
|
@ -621,6 +621,7 @@ public class ExchangeSession {
|
||||||
public MessageList getAllMessages(String folderName) throws IOException {
|
public MessageList getAllMessages(String folderName) throws IOException {
|
||||||
return searchMessages(folderName, "");
|
return searchMessages(folderName, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public MessageList searchMessages(String folderName, String conditions) throws IOException {
|
public MessageList searchMessages(String folderName, String conditions) throws IOException {
|
||||||
String folderUrl = getFolderPath(folderName);
|
String folderUrl = getFolderPath(folderName);
|
||||||
MessageList messages = new MessageList();
|
MessageList messages = new MessageList();
|
||||||
|
@ -630,7 +631,7 @@ public class ExchangeSession {
|
||||||
" ,\"urn:schemas:mailheader:message-id\", \"urn:schemas:httpmail:read\", \"DAV:isdeleted\"" +
|
" ,\"urn:schemas:mailheader:message-id\", \"urn:schemas:httpmail:read\", \"DAV:isdeleted\"" +
|
||||||
" FROM Scope('SHALLOW TRAVERSAL OF \"" + folderUrl + "\"')\n" +
|
" FROM Scope('SHALLOW TRAVERSAL OF \"" + folderUrl + "\"')\n" +
|
||||||
" WHERE \"DAV:ishidden\" = False AND \"DAV:isfolder\" = False\n" +
|
" WHERE \"DAV:ishidden\" = False AND \"DAV:isfolder\" = False\n" +
|
||||||
conditions+
|
conditions +
|
||||||
" ORDER BY \"urn:schemas:httpmail:date\" ASC";
|
" ORDER BY \"urn:schemas:httpmail:date\" ASC";
|
||||||
Enumeration folderEnum = DavGatewayHttpClientFacade.executeSearchMethod(wdr.retrieveSessionInstance(), folderUrl, searchRequest);
|
Enumeration folderEnum = DavGatewayHttpClientFacade.executeSearchMethod(wdr.retrieveSessionInstance(), folderUrl, searchRequest);
|
||||||
|
|
||||||
|
@ -703,10 +704,10 @@ public class ExchangeSession {
|
||||||
} else {
|
} else {
|
||||||
int index = href.indexOf(mailPath.substring(0, mailPath.length() - 1));
|
int index = href.indexOf(mailPath.substring(0, mailPath.length() - 1));
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
if (index + mailPath.length()>href.length()) {
|
if (index + mailPath.length() > href.length()) {
|
||||||
folder.folderUrl= "";
|
folder.folderUrl = "";
|
||||||
} else {
|
} else {
|
||||||
folder.folderUrl = href.substring(index + mailPath.length());
|
folder.folderUrl = href.substring(index + mailPath.length());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new URIException("Invalid folder url: " + folder.folderUrl);
|
throw new URIException("Invalid folder url: " + folder.folderUrl);
|
||||||
|
@ -1324,13 +1325,25 @@ public class ExchangeSession {
|
||||||
if (!isAppleiCal) {
|
if (!isAppleiCal) {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
result.writeLine("CLASS:" + eventClass);
|
if ("CONFIDENTIAL".equalsIgnoreCase(eventClass)) {
|
||||||
|
result.writeLine("CLASS:PRIVATE");
|
||||||
|
} else if ("PRIVATE".equalsIgnoreCase(eventClass)) {
|
||||||
|
result.writeLine("CLASS:CONFIDENTIAL");
|
||||||
|
} else {
|
||||||
|
result.writeLine("CLASS:" + eventClass);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (line.startsWith("CLASS:")) {
|
} else if (line.startsWith("CLASS:")) {
|
||||||
if (isAppleiCal) {
|
if (isAppleiCal) {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
result.writeLine("X-CALENDARSERVER-ACCESS:" + eventClass);
|
if ("PRIVATE".equalsIgnoreCase(eventClass)) {
|
||||||
|
result.writeLine("X-CALENDARSERVER-ACCESS:CONFIDENTIAL");
|
||||||
|
} else if ("CONFIDENTIAL".equalsIgnoreCase(eventClass)) {
|
||||||
|
result.writeLine("X-CALENDARSERVER-ACCESS:PRIVATE");
|
||||||
|
} else {
|
||||||
|
result.writeLine("X-CALENDARSERVER-ACCESS:" + eventClass);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result.writeLine(line);
|
result.writeLine(line);
|
||||||
|
|
Loading…
Reference in New Issue