Monotone-Parent: 6ad0713108beb5244446e83f17724cf5b9cee560

Monotone-Revision: e68f0a3422367e930eb3d030ebd4a65ee79e3581

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-09-27T14:44:53
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2011-09-27 14:44:53 +00:00
parent 431ebf8a61
commit fd2f5dfb67
2 changed files with 17 additions and 5 deletions

View File

@@ -1,5 +1,10 @@
2011-09-27 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreFolder.m
(-moveCopyMessagesWithMID:fromFolder:withMID:wantCopy:): ensure
the message URL exists in the MAPIStoreMapping, otherwise fail
with MAPISTORE_ERR_NOT_FOUND, to avoid a crash.
* OpenChange/MAPIStoreFSMessage.m (-objectVersion): return
0xff...fff when "version" does not exist in the object properties.

View File

@@ -641,6 +641,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
int rc = MAPISTORE_SUCCESS;
NSUInteger count;
NSMutableArray *oldMessageURLs;
NSString *oldMessageURL;
MAPIStoreMapping *mapping;
if ([sourceFolder isKindOfClass: isa]
@@ -651,11 +652,17 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
mapping = [[self context] mapping];
for (count = 0; rc == MAPISTORE_SUCCESS && count < midCount; count++)
{
[oldMessageURLs addObject: [mapping urlFromID: srcMids[count]]];
rc = [self moveCopyMessageWithMID: srcMids[count]
fromFolder: sourceFolder
withMID: targetMids[count]
wantCopy: wantCopy];
oldMessageURL = [mapping urlFromID: srcMids[count]];
if (oldMessageURL)
{
[oldMessageURLs addObject: oldMessageURL];
rc = [self moveCopyMessageWithMID: srcMids[count]
fromFolder: sourceFolder
withMID: targetMids[count]
wantCopy: wantCopy];
}
else
rc = MAPISTORE_ERR_NOT_FOUND;
}
/* Notifications */