Monotone-Parent: e68f0a3422367e930eb3d030ebd4a65ee79e3581

Monotone-Revision: 5d7bbc47e52cef4525e08da156339e1558c1dd2d

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-09-27T18:26:40
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2011-09-27 18:26:40 +00:00
parent fd2f5dfb67
commit 38565376af
4 changed files with 15 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2011-09-27 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreSOGo.m (sogo_folder_move_copy_messages):
added the "target_change_keys" parameter.
* OpenChange/MAPIStoreFolder.m
(-moveCopyMessagesWithMID:fromFolder:withMID:wantCopy:): ensure
the message URL exists in the MAPIStoreMapping, otherwise fail

View File

@ -556,6 +556,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
- (int) moveCopyMessageWithMID: (uint64_t) srcMid
fromFolder: (MAPIStoreFolder *) sourceFolder
withMID: (uint64_t) targetMid
andChangeKey: (struct Binary_r *) targetChangeKey
wantCopy: (uint8_t) wantCopy
{
int rc;
@ -636,6 +637,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
andCount: (uint32_t) midCount
fromFolder: (MAPIStoreFolder *) sourceFolder
withMIDs: (uint64_t *) targetMids
andChangeKeys: (struct Binary_r **) targetChangeKeys
wantCopy: (uint8_t) wantCopy
{
int rc = MAPISTORE_SUCCESS;
@ -643,6 +645,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
NSMutableArray *oldMessageURLs;
NSString *oldMessageURL;
MAPIStoreMapping *mapping;
struct Binary_r *targetChangeKey;
if ([sourceFolder isKindOfClass: isa]
|| [self isKindOfClass: [sourceFolder class]])
@ -656,9 +659,14 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
if (oldMessageURL)
{
[oldMessageURLs addObject: oldMessageURL];
if (targetChangeKeys)
targetChangeKey = targetChangeKeys[count];
else
targetChangeKey = NULL;
rc = [self moveCopyMessageWithMID: srcMids[count]
fromFolder: sourceFolder
withMID: targetMids[count]
andChangeKey: targetChangeKey
wantCopy: wantCopy];
}
else

View File

@ -875,6 +875,7 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
andCount: (uint32_t) midCount
fromFolder: (MAPIStoreFolder *) sourceFolder
withMIDs: (uint64_t *) targetMids
andChangeKeys: (struct Binary_r **) targetChangeKeys
wantCopy: (uint8_t) wantCopy
{
NGImap4Connection *connection;
@ -891,6 +892,7 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
if (![sourceFolder isKindOfClass: [MAPIStoreMailFolder class]])
return [super moveCopyMessagesWithMIDs: srcMids andCount: midCount
fromFolder: sourceFolder withMIDs: targetMids
andChangeKeys: targetChangeKeys
wantCopy: wantCopy];
/* Conversion of mids to IMAP uids */

View File

@ -447,6 +447,7 @@ sogo_folder_move_copy_messages(void *folder_object,
void *source_folder_object,
uint32_t mid_count,
uint64_t *src_mids, uint64_t *t_mids,
struct Binary_r **target_change_keys,
uint8_t want_copy)
{
MAPIStoreFolder *sourceFolder, *targetFolder;
@ -469,6 +470,7 @@ sogo_folder_move_copy_messages(void *folder_object,
andCount: mid_count
fromFolder: sourceFolder
withMIDs: t_mids
andChangeKeys: target_change_keys
wantCopy: want_copy];
[pool release];
}