mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-21 23:18:49 -05:00
Fix #35 duplicates in updated reoccurring events
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2307 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
d071c59e4a
commit
6960cb58e9
@ -186,11 +186,11 @@ public class EwsExchangeSession extends ExchangeSession {
|
|||||||
if (status == HttpStatus.SC_UNAUTHORIZED) {
|
if (status == HttpStatus.SC_UNAUTHORIZED) {
|
||||||
throw new DavMailAuthenticationException("EXCEPTION_AUTHENTICATION_FAILED");
|
throw new DavMailAuthenticationException("EXCEPTION_AUTHENTICATION_FAILED");
|
||||||
} else if (status != HttpStatus.SC_OK) {
|
} else if (status != HttpStatus.SC_OK) {
|
||||||
throw new IOException("Ews endpoint not available at " + checkMethod.getURI().toString()+" status "+status);
|
throw new IOException("Ews endpoint not available at " + checkMethod.getURI().toString() + " status " + status);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (status != HttpStatus.SC_OK) {
|
} else if (status != HttpStatus.SC_OK) {
|
||||||
throw new IOException("Ews endpoint not available at " + checkMethod.getURI().toString()+" status "+status);
|
throw new IOException("Ews endpoint not available at " + checkMethod.getURI().toString() + " status " + status);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
checkMethod.releaseConnection();
|
checkMethod.releaseConnection();
|
||||||
@ -306,7 +306,7 @@ public class EwsExchangeSession extends ExchangeSession {
|
|||||||
String searchValue = userName;
|
String searchValue = userName;
|
||||||
int index = searchValue.indexOf('\\');
|
int index = searchValue.indexOf('\\');
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
searchValue = searchValue.substring(index+1);
|
searchValue = searchValue.substring(index + 1);
|
||||||
}
|
}
|
||||||
ResolveNamesMethod resolveNamesMethod = new ResolveNamesMethod(searchValue);
|
ResolveNamesMethod resolveNamesMethod = new ResolveNamesMethod(searchValue);
|
||||||
try {
|
try {
|
||||||
@ -801,10 +801,10 @@ public class EwsExchangeSession extends ExchangeSession {
|
|||||||
|
|
||||||
long highestUid = 0;
|
long highestUid = 0;
|
||||||
if (resultCount > 0) {
|
if (resultCount > 0) {
|
||||||
highestUid = Long.parseLong(results.get(resultCount-1).get(Field.get("imapUid").getResponseName()));
|
highestUid = Long.parseLong(results.get(resultCount - 1).get(Field.get("imapUid").getResponseName()));
|
||||||
}
|
}
|
||||||
// Only add new result if not already available (concurrent folder changes issue)
|
// Only add new result if not already available (concurrent folder changes issue)
|
||||||
for (EWSMethod.Item item:findItemMethod.getResponseItems()) {
|
for (EWSMethod.Item item : findItemMethod.getResponseItems()) {
|
||||||
long imapUid = Long.parseLong(item.get(Field.get("imapUid").getResponseName()));
|
long imapUid = Long.parseLong(item.get(Field.get("imapUid").getResponseName()));
|
||||||
if (imapUid > highestUid) {
|
if (imapUid > highestUid) {
|
||||||
results.add(item);
|
results.add(item);
|
||||||
@ -812,9 +812,9 @@ public class EwsExchangeSession extends ExchangeSession {
|
|||||||
}
|
}
|
||||||
resultCount = results.size();
|
resultCount = results.size();
|
||||||
if (resultCount > 0 && LOGGER.isDebugEnabled()) {
|
if (resultCount > 0 && LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug("Folder " + folderPath + " - Search items current count: "+resultCount+" fetchCount: "+fetchCount
|
LOGGER.debug("Folder " + folderPath + " - Search items current count: " + resultCount + " fetchCount: " + fetchCount
|
||||||
+" highest uid: "+results.get(resultCount-1).get(Field.get("imapUid").getResponseName())
|
+ " highest uid: " + results.get(resultCount - 1).get(Field.get("imapUid").getResponseName())
|
||||||
+" lowest uid: "+results.get(0).get(Field.get("imapUid").getResponseName()));
|
+ " lowest uid: " + results.get(0).get(Field.get("imapUid").getResponseName()));
|
||||||
}
|
}
|
||||||
if (Thread.interrupted()) {
|
if (Thread.interrupted()) {
|
||||||
LOGGER.debug("Folder " + folderPath + " - Search items failed: Interrupted by client");
|
LOGGER.debug("Folder " + folderPath + " - Search items failed: Interrupted by client");
|
||||||
@ -1021,7 +1021,7 @@ public class EwsExchangeSession extends ExchangeSession {
|
|||||||
if ("from".equals(headerName)
|
if ("from".equals(headerName)
|
||||||
|| "to".equals(headerName)
|
|| "to".equals(headerName)
|
||||||
|| "cc".equals(headerName)) {
|
|| "cc".equals(headerName)) {
|
||||||
return new AttributeCondition("msg"+headerName, Operator.Contains, value, ContainmentMode.Substring, ContainmentComparison.IgnoreCase);
|
return new AttributeCondition("msg" + headerName, Operator.Contains, value, ContainmentMode.Substring, ContainmentComparison.IgnoreCase);
|
||||||
} else if ("message-id".equals(headerName)
|
} else if ("message-id".equals(headerName)
|
||||||
|| "bcc".equals(headerName)) {
|
|| "bcc".equals(headerName)) {
|
||||||
return new AttributeCondition(headerName, Operator.Contains, value, ContainmentMode.Substring, ContainmentComparison.IgnoreCase);
|
return new AttributeCondition(headerName, Operator.Contains, value, ContainmentMode.Substring, ContainmentComparison.IgnoreCase);
|
||||||
@ -1832,7 +1832,6 @@ public class EwsExchangeSession extends ExchangeSession {
|
|||||||
executeMethod(getOccurrenceMethod);
|
executeMethod(getOccurrenceMethod);
|
||||||
fixAttendees(getOccurrenceMethod, modifiedOccurrence);
|
fixAttendees(getOccurrenceMethod, modifiedOccurrence);
|
||||||
|
|
||||||
if ("Exchange2007_SP1".equals(serverVersion)) {
|
|
||||||
// fix uid, should be the same as main VEVENT
|
// fix uid, should be the same as main VEVENT
|
||||||
if (calendaruid != null) {
|
if (calendaruid != null) {
|
||||||
modifiedOccurrence.setPropertyValue("UID", calendaruid);
|
modifiedOccurrence.setPropertyValue("UID", calendaruid);
|
||||||
@ -1846,7 +1845,6 @@ public class EwsExchangeSession extends ExchangeSession {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// restore mozilla invitations option
|
// restore mozilla invitations option
|
||||||
localVCalendar.setFirstVeventPropertyValue("X-MOZ-SEND-INVITATIONS",
|
localVCalendar.setFirstVeventPropertyValue("X-MOZ-SEND-INVITATIONS",
|
||||||
getItemMethod.getResponseItem().get(Field.get("xmozsendinvitations").getResponseName()));
|
getItemMethod.getResponseItem().get(Field.get("xmozsendinvitations").getResponseName()));
|
||||||
@ -2569,6 +2567,7 @@ public class EwsExchangeSession extends ExchangeSession {
|
|||||||
/**
|
/**
|
||||||
* Check if itemName is long and base64 encoded.
|
* Check if itemName is long and base64 encoded.
|
||||||
* User generated item names are usually short
|
* User generated item names are usually short
|
||||||
|
*
|
||||||
* @param itemName item name
|
* @param itemName item name
|
||||||
* @return true if itemName is an EWS item id
|
* @return true if itemName is an EWS item id
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user