1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-08-13 16:53:51 -04:00

Caldav : revert previous changes and fix meeting cancel support (IPM.Schedule.Meeting.Canceled)

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1400 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-08-31 23:11:32 +00:00
parent eece3d6b85
commit 3b829cefdc
2 changed files with 7 additions and 11 deletions

View File

@ -2247,7 +2247,9 @@ public abstract class ExchangeSession {
*/
public List<Event> getEventMessages(String folderPath) throws IOException {
return searchEvents(folderPath, ITEM_PROPERTIES,
and(isEqualTo("outlookmessageclass", "IPM.Schedule.Meeting.Request")));
and(or(isEqualTo("outlookmessageclass", "IPM.Schedule.Meeting.Request"),
isEqualTo("outlookmessageclass", "IPM.Schedule.Meeting.Canceled")),
or(isNull("processed"), isFalse("processed"))));
}
/**

View File

@ -1869,14 +1869,12 @@ public class DavExchangeSession extends ExchangeSession {
@Override
public void processItem(String folderPath, String itemName) throws IOException {
String eventPath = URIUtil.encodePath(getFolderPath(folderPath) + '/' + convertItemNameToEML(itemName));
// mark read
// do not delete calendar messages, mark read and processed
ArrayList<DavConstants> list = new ArrayList<DavConstants>();
//list.add(Field.createDavProperty("processed", "true"));
list.add(Field.createDavProperty("processed", "true"));
list.add(Field.createDavProperty("read", "1"));
PropPatchMethod patchMethod = new PropPatchMethod(eventPath, list);
DavGatewayHttpClientFacade.executeMethod(httpClient, patchMethod);
// move to trash
moveToTrash(eventPath);
}
@Override
@ -2297,13 +2295,9 @@ public class DavExchangeSession extends ExchangeSession {
@Override
protected void moveToTrash(ExchangeSession.Message message) throws IOException {
moveToTrash(message.permanentUrl);
}
protected void moveToTrash(String messageUrl) throws IOException {
String destination = URIUtil.encodePath(deleteditemsUrl) + '/' + UUID.randomUUID().toString();
LOGGER.debug("Deleting : " + messageUrl + " to " + destination);
MoveMethod method = new MoveMethod(messageUrl, destination, false);
LOGGER.debug("Deleting : " + message.permanentUrl + " to " + destination);
MoveMethod method = new MoveMethod(message.permanentUrl, destination, false);
method.addRequestHeader("Allow-rename", "t");
int status = DavGatewayHttpClientFacade.executeHttpMethod(httpClient, method);