mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
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 {
|
||||
return searchMessages(folderName, "");
|
||||
}
|
||||
|
||||
public MessageList searchMessages(String folderName, String conditions) throws IOException {
|
||||
String folderUrl = getFolderPath(folderName);
|
||||
MessageList messages = new MessageList();
|
||||
@ -630,7 +631,7 @@ public class ExchangeSession {
|
||||
" ,\"urn:schemas:mailheader:message-id\", \"urn:schemas:httpmail:read\", \"DAV:isdeleted\"" +
|
||||
" FROM Scope('SHALLOW TRAVERSAL OF \"" + folderUrl + "\"')\n" +
|
||||
" WHERE \"DAV:ishidden\" = False AND \"DAV:isfolder\" = False\n" +
|
||||
conditions+
|
||||
conditions +
|
||||
" ORDER BY \"urn:schemas:httpmail:date\" ASC";
|
||||
Enumeration folderEnum = DavGatewayHttpClientFacade.executeSearchMethod(wdr.retrieveSessionInstance(), folderUrl, searchRequest);
|
||||
|
||||
@ -703,10 +704,10 @@ public class ExchangeSession {
|
||||
} else {
|
||||
int index = href.indexOf(mailPath.substring(0, mailPath.length() - 1));
|
||||
if (index >= 0) {
|
||||
if (index + mailPath.length()>href.length()) {
|
||||
folder.folderUrl= "";
|
||||
if (index + mailPath.length() > href.length()) {
|
||||
folder.folderUrl = "";
|
||||
} else {
|
||||
folder.folderUrl = href.substring(index + mailPath.length());
|
||||
folder.folderUrl = href.substring(index + mailPath.length());
|
||||
}
|
||||
} else {
|
||||
throw new URIException("Invalid folder url: " + folder.folderUrl);
|
||||
@ -1324,13 +1325,25 @@ public class ExchangeSession {
|
||||
if (!isAppleiCal) {
|
||||
continue;
|
||||
} 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:")) {
|
||||
if (isAppleiCal) {
|
||||
continue;
|
||||
} 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user