diff --git a/OpenChange/MAPIStoreFolder.h b/OpenChange/MAPIStoreFolder.h index b16e4b91f..3f3bfb204 100644 --- a/OpenChange/MAPIStoreFolder.h +++ b/OpenChange/MAPIStoreFolder.h @@ -121,6 +121,7 @@ fromFolder: (MAPIStoreFolder *) sourceFolder withMIDs: (uint64_t *) targetMids andChangeKeys: (struct Binary_r **) targetChangeKeys + andPredecessorChangeLists: (struct Binary_r **) targetPredecessorChangeLists wantCopy: (uint8_t) want_copy inMemCtx: (TALLOC_CTX *) memCtx; diff --git a/OpenChange/MAPIStoreFolder.m b/OpenChange/MAPIStoreFolder.m index 7ca80e749..ac3b19bf3 100644 --- a/OpenChange/MAPIStoreFolder.m +++ b/OpenChange/MAPIStoreFolder.m @@ -642,6 +642,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe fromFolder: (MAPIStoreFolder *) sourceFolder withMID: (uint64_t) targetMid andChangeKey: (struct Binary_r *) targetChangeKey + andPredecessorChangeList: (struct Binary_r *) targetPredecessorChangeList wantCopy: (uint8_t) wantCopy inMemCtx: (TALLOC_CTX *) memCtx { @@ -696,6 +697,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe fromFolder: (MAPIStoreFolder *) sourceFolder withMIDs: (uint64_t *) targetMids andChangeKeys: (struct Binary_r **) targetChangeKeys + andPredecessorChangeLists: (struct Binary_r **) targetPredecessorChangeLists wantCopy: (uint8_t) wantCopy inMemCtx: (TALLOC_CTX *) memCtx { @@ -705,7 +707,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe NSString *oldMessageURL; MAPIStoreMapping *mapping; SOGoUser *ownerUser; - struct Binary_r *targetChangeKey; + struct Binary_r *targetChangeKey, *targetPredecessorChangeList; //TALLOC_CTX *memCtx; //memCtx = talloc_zero (NULL, TALLOC_CTX); @@ -726,14 +728,21 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe if (oldMessageURL) { [oldMessageURLs addObject: oldMessageURL]; - if (targetChangeKeys) - targetChangeKey = targetChangeKeys[count]; + if (targetChangeKeys && targetPredecessorChangeList) + { + targetChangeKey = targetChangeKeys[count]; + targetPredecessorChangeList = targetPredecessorChangeLists[count]; + } else - targetChangeKey = NULL; + { + targetChangeKey = NULL; + targetPredecessorChangeList = NULL; + } rc = [self _moveCopyMessageWithMID: srcMids[count] fromFolder: sourceFolder withMID: targetMids[count] andChangeKey: targetChangeKey + andPredecessorChangeList: targetPredecessorChangeList wantCopy: wantCopy inMemCtx: memCtx]; } diff --git a/OpenChange/MAPIStoreMailFolder.m b/OpenChange/MAPIStoreMailFolder.m index 4f66fc2f4..9026dcbf8 100644 --- a/OpenChange/MAPIStoreMailFolder.m +++ b/OpenChange/MAPIStoreMailFolder.m @@ -1217,6 +1217,7 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP) fromFolder: (MAPIStoreFolder *) sourceFolder withMIDs: (uint64_t *) targetMids andChangeKeys: (struct Binary_r **) targetChangeKeys + andPredecessorChangeLists: (struct Binary_r **) targetPredecessorChangeLists wantCopy: (uint8_t) wantCopy inMemCtx: (TALLOC_CTX *) memCtx @@ -1237,6 +1238,7 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP) return [super moveCopyMessagesWithMIDs: srcMids andCount: midCount fromFolder: sourceFolder withMIDs: targetMids andChangeKeys: targetChangeKeys + andPredecessorChangeLists: targetPredecessorChangeLists wantCopy: wantCopy inMemCtx: memCtx]; diff --git a/OpenChange/MAPIStoreSOGo.m b/OpenChange/MAPIStoreSOGo.m index c11967a0e..0923c44b5 100644 --- a/OpenChange/MAPIStoreSOGo.m +++ b/OpenChange/MAPIStoreSOGo.m @@ -674,6 +674,7 @@ sogo_folder_move_copy_messages(void *folder_object, uint32_t mid_count, uint64_t *src_mids, uint64_t *t_mids, struct Binary_r **target_change_keys, + struct Binary_r **target_predecessor_change_lists, uint8_t want_copy) { MAPIStoreFolder *sourceFolder, *targetFolder; @@ -698,6 +699,7 @@ sogo_folder_move_copy_messages(void *folder_object, fromFolder: sourceFolder withMIDs: t_mids andChangeKeys: target_change_keys + andPredecessorChangeLists: target_predecessor_change_lists wantCopy: want_copy inMemCtx: mem_ctx]; TRYCATCH_END(pool)