diff --git a/ChangeLog b/ChangeLog index 448a73e93..b7ba74aed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2011-09-27 Wolfgang Sourdeau + * 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 diff --git a/OpenChange/MAPIStoreFolder.m b/OpenChange/MAPIStoreFolder.m index e758d3eb6..354115c88 100644 --- a/OpenChange/MAPIStoreFolder.m +++ b/OpenChange/MAPIStoreFolder.m @@ -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 diff --git a/OpenChange/MAPIStoreMailFolder.m b/OpenChange/MAPIStoreMailFolder.m index a9a86fa50..eabcfb2ec 100644 --- a/OpenChange/MAPIStoreMailFolder.m +++ b/OpenChange/MAPIStoreMailFolder.m @@ -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 */ diff --git a/OpenChange/MAPIStoreSOGo.m b/OpenChange/MAPIStoreSOGo.m index b58138bb5..3c041100a 100644 --- a/OpenChange/MAPIStoreSOGo.m +++ b/OpenChange/MAPIStoreSOGo.m @@ -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]; }