Commit 0859a289 authored by Mickaël Guessant's avatar Mickaël Guessant

EWS: improve main calendar folder test

git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@2326 3d1905a2-6b24-0410-a738-b14d5a86fcbd
parent 092747ec
......@@ -3304,7 +3304,7 @@ public abstract class ExchangeSession {
* @param folderPath absolute folder path
* @return true if folderPath is a public or shared folder
*/
public abstract boolean isMainCalendar(String folderPath);
public abstract boolean isMainCalendar(String folderPath) throws IOException;
static final String MAILBOX_BASE = "/cn=";
......
......@@ -1715,7 +1715,7 @@ public class EwsExchangeSession extends ExchangeSession {
createOrUpdateItemMethod.setTimezoneContext(EwsExchangeSession.this.getVTimezone().getPropertyValue("TZID"));
}
//}
}
}
executeMethod(createOrUpdateItemMethod);
itemResult.status = createOrUpdateItemMethod.getStatusCode();
......@@ -2160,8 +2160,10 @@ public class EwsExchangeSession extends ExchangeSession {
}
@Override
public boolean isMainCalendar(String folderPath) {
return "calendar".equalsIgnoreCase(folderPath) || (currentMailboxPath + "/calendar").equalsIgnoreCase(folderPath);
public boolean isMainCalendar(String folderPath) throws IOException {
FolderId currentFolderId = getFolderId(folderPath);
FolderId calendarFolderId = getFolderId("calendar");
return calendarFolderId.name.equals(currentFolderId.name) && calendarFolderId.value.equals(currentFolderId.value);
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment