mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-12 22:18:11 -05:00
Caldav: Send events back to the client after each get on REPORT request (avoid iCal timeout)
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@496 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
44c4cba9fd
commit
0998567fdf
@ -436,6 +436,9 @@ public class CaldavConnection extends AbstractConnection {
|
||||
public void reportEvents(CaldavRequest request, String principal, String path) throws IOException {
|
||||
List<ExchangeSession.Event> events;
|
||||
List<String> notFound = new ArrayList<String>();
|
||||
|
||||
CaldavResponse response = new CaldavResponse(HttpStatus.SC_MULTI_STATUS);
|
||||
response.startMultistatus();
|
||||
if (request.isMultiGet()) {
|
||||
events = new ArrayList<ExchangeSession.Event>();
|
||||
int count = 0;
|
||||
@ -449,7 +452,7 @@ public class CaldavConnection extends AbstractConnection {
|
||||
} else if ("inbox".equals(eventName) || "calendar".equals(eventName)) {
|
||||
// Sunbird: just ignore
|
||||
} else {
|
||||
events.add(session.getEvent(principal, path, eventName));
|
||||
appendEventResponse(response, request, path, session.getEvent(principal, path, eventName));
|
||||
}
|
||||
} catch (HttpException e) {
|
||||
notFound.add(href);
|
||||
@ -457,14 +460,12 @@ public class CaldavConnection extends AbstractConnection {
|
||||
}
|
||||
} else if ("INBOX".equals(path)) {
|
||||
events = session.getEventMessages(principal);
|
||||
appendEventsResponses(response, request, path, events);
|
||||
} else {
|
||||
events = session.getAllEvents(principal);
|
||||
appendEventsResponses(response, request, path, events);
|
||||
}
|
||||
|
||||
CaldavResponse response = new CaldavResponse(HttpStatus.SC_MULTI_STATUS);
|
||||
response.startMultistatus();
|
||||
appendEventsResponses(response, request, path, events);
|
||||
|
||||
// send not found events errors
|
||||
for (String href : notFound) {
|
||||
response.startResponse(URIUtil.encodePath(href));
|
||||
|
@ -1237,7 +1237,6 @@ public class ExchangeSession {
|
||||
|
||||
public Event getEvent(String principal, String path, String eventName) throws IOException {
|
||||
String eventPath = URIUtil.encodePath(replacePrincipal(getFolderPath(path), principal)) + "/" + URIUtil.encodeWithinQuery(eventName);
|
||||
LOGGER.debug("getEvent(" + eventPath + "/" + eventName + ")");
|
||||
MultiStatusResponse[] responses = DavGatewayHttpClientFacade.executePropFindMethod(httpClient, eventPath, 0, EVENT_REQUEST_PROPERTIES);
|
||||
if (responses.length == 0) {
|
||||
throw new IOException("Unable to get calendar event");
|
||||
|
Loading…
Reference in New Issue
Block a user