1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 11:12:22 -05:00

Caldav: iPhone workaround: send calendar subfolder

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@638 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-07-31 12:20:58 +00:00
parent c75ac74f4c
commit 834582b53b

View File

@ -562,6 +562,22 @@ public class CaldavConnection extends AbstractConnection {
response.endPropStatOK(); response.endPropStatOK();
response.endResponse(); response.endResponse();
if (request.depth == 1) { if (request.depth == 1) {
// iPhone workaround: send calendar subfolder
response.startResponse("/users/"+session.getEmail()+"/calendar");
response.startPropstat();
if (request.hasProperty("resourcetype")) {
response.appendProperty("D:resourcetype", "<D:collection/>" +
"<C:calendar xmlns:C=\"urn:ietf:params:xml:ns:caldav\"/>");
}
if (request.hasProperty("displayname")) {
response.appendProperty("D:displayname", session.getEmail());
}
if (request.hasProperty("supported-calendar-component-set")) {
response.appendProperty("C:supported-calendar-component-set", "<C:comp name=\"VEVENT\"/><C:comp name=\"VTODO\"/>");
}
response.endPropStatOK();
response.endResponse();
response.startResponse("/users"); response.startResponse("/users");
response.startPropstat(); response.startPropstat();
if (request.hasProperty("displayname")) { if (request.hasProperty("displayname")) {
@ -963,7 +979,7 @@ public class CaldavConnection extends AbstractConnection {
protected boolean isIcal() { protected boolean isIcal() {
String userAgent = headers.get("user-agent"); String userAgent = headers.get("user-agent");
return userAgent != null && userAgent.indexOf("DAVKit") >= 0; return userAgent != null && userAgent.indexOf("DAVKit/3") >= 0;
} }
public boolean isFreeBusy() { public boolean isFreeBusy() {