mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-14 03:32:22 -05:00
Caldav: try to improve responses for iCal
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@650 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
0515fca2b6
commit
90f3431270
@ -347,7 +347,7 @@ public class CaldavConnection extends AbstractConnection {
|
|||||||
|
|
||||||
if (request.hasProperty("resourcetype")) {
|
if (request.hasProperty("resourcetype")) {
|
||||||
response.appendProperty("D:resourcetype", "<D:collection/>" +
|
response.appendProperty("D:resourcetype", "<D:collection/>" +
|
||||||
"<C:calendar xmlns:C=\"urn:ietf:params:xml:ns:caldav\"/>");
|
"<C:calendar/>");
|
||||||
}
|
}
|
||||||
if (request.hasProperty("owner")) {
|
if (request.hasProperty("owner")) {
|
||||||
if ("users".equals(request.getPathElement(1))) {
|
if ("users".equals(request.getPathElement(1))) {
|
||||||
@ -373,6 +373,10 @@ public class CaldavConnection extends AbstractConnection {
|
|||||||
response.appendProperty("D:displayname", subFolder);
|
response.appendProperty("D:displayname", subFolder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (request.hasProperty("calendar-description")) {
|
||||||
|
response.appendProperty("C:calendar-description", "");
|
||||||
|
}
|
||||||
|
|
||||||
response.endPropStatOK();
|
response.endPropStatOK();
|
||||||
response.endResponse();
|
response.endResponse();
|
||||||
}
|
}
|
||||||
@ -604,6 +608,10 @@ public class CaldavConnection extends AbstractConnection {
|
|||||||
if (request.hasProperty("displayname")) {
|
if (request.hasProperty("displayname")) {
|
||||||
response.appendProperty("D:displayname", request.getLastPath());
|
response.appendProperty("D:displayname", request.getLastPath());
|
||||||
}
|
}
|
||||||
|
if (request.hasProperty("getctag")) {
|
||||||
|
response.appendProperty("CS:getctag", "CS=\"http://calendarserver.org/ns/\"",
|
||||||
|
base64Encode(session.getFolderCtag(request.getExchangeFolderPath())));
|
||||||
|
}
|
||||||
response.endPropStatOK();
|
response.endPropStatOK();
|
||||||
if (request.getDepth() == 1) {
|
if (request.getDepth() == 1) {
|
||||||
appendInbox(response, request, "inbox");
|
appendInbox(response, request, "inbox");
|
||||||
@ -703,7 +711,7 @@ public class CaldavConnection extends AbstractConnection {
|
|||||||
|
|
||||||
if (request.hasProperty("calendar-home-set")) {
|
if (request.hasProperty("calendar-home-set")) {
|
||||||
if ("users".equals(prefix)) {
|
if ("users".equals(prefix)) {
|
||||||
response.appendHrefProperty("C:calendar-home-set", "/users/" + actualPrincipal + "/calendar");
|
response.appendHrefProperty("C:calendar-home-set", "/users/" + actualPrincipal + "/calendar/");
|
||||||
} else {
|
} else {
|
||||||
response.appendHrefProperty("C:calendar-home-set", '/' + prefix + '/' + actualPrincipal);
|
response.appendHrefProperty("C:calendar-home-set", '/' + prefix + '/' + actualPrincipal);
|
||||||
}
|
}
|
||||||
@ -1122,12 +1130,18 @@ public class CaldavConnection extends AbstractConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getPath(String subFolder) {
|
public String getPath(String subFolder) {
|
||||||
|
String folderPath = null;
|
||||||
if (subFolder == null || subFolder.length() == 0) {
|
if (subFolder == null || subFolder.length() == 0) {
|
||||||
return path;
|
folderPath = path;
|
||||||
} else if (path.endsWith("/")) {
|
} else if (path.endsWith("/")) {
|
||||||
return path + subFolder;
|
folderPath = path + subFolder;
|
||||||
} else {
|
} else {
|
||||||
return path + '/' + subFolder;
|
folderPath = path + '/' + subFolder;
|
||||||
|
}
|
||||||
|
if (folderPath.endsWith("/")) {
|
||||||
|
return folderPath;
|
||||||
|
} else {
|
||||||
|
return folderPath + '/';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user