1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-21 15:08:52 -05:00

EWS: Improve Exchange 2013 support

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2284 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2014-04-07 21:16:54 +00:00
parent 8ab1160567
commit 89d0ed029f
2 changed files with 12 additions and 6 deletions

View File

@ -437,7 +437,7 @@ public abstract class EWSMethod extends PostMethod {
}
/**
* Get Exchange server version, Exchange2010 or Exchange2007_SP1
* Get Exchange server version, Exchange2013, Exchange2010 or Exchange2007_SP1
*
* @return server version
*/
@ -1103,8 +1103,14 @@ public abstract class EWSMethod extends PostMethod {
handleErrors(reader);
if (serverVersion == null && XMLStreamUtil.isStartTag(reader, "ServerVersionInfo")) {
String majorVersion = getAttributeValue(reader, "MajorVersion");
if ("14".equals(majorVersion)) {
String minorVersion = getAttributeValue(reader, "MinorVersion");
String minorVersion = getAttributeValue(reader, "MinorVersion");
if ("15".equals(majorVersion)) {
if ("0".equals(minorVersion)) {
serverVersion = "Exchange2013";
} else {
serverVersion = "Exchange2013_SP1";
}
} else if ("14".equals(majorVersion)) {
if ("0".equals(minorVersion)) {
serverVersion = "Exchange2010";
} else {

View File

@ -969,7 +969,7 @@ public class EwsExchangeSession extends ExchangeSession {
@Override
public Condition headerIsEqualTo(String headerName, String value) {
if (serverVersion.startsWith("Exchange2010")) {
if (serverVersion.startsWith("Exchange201")) {
if ("from".equals(headerName)
|| "to".equals(headerName)
|| "cc".equals(headerName)) {
@ -1631,8 +1631,8 @@ public class EwsExchangeSession extends ExchangeSession {
newItem.setFieldUpdates(updates);
createOrUpdateItemMethod = new CreateItemMethod(MessageDisposition.SaveOnly, SendMeetingInvitations.SendToNone, getFolderId(folderPath), newItem);
// force context Timezone on Exchange 2010
if (serverVersion != null && serverVersion.startsWith("Exchange2010")) {
// force context Timezone on Exchange 2010 and 2013
if (serverVersion != null && serverVersion.startsWith("Exchange201")) {
createOrUpdateItemMethod.setTimezoneContext(EwsExchangeSession.this.getVTimezone().getPropertyValue("TZID"));
}
//}