merge of '517b0b095f30f6f2f92a4da5dfe0155872190daa'

and '5d7bbc47e52cef4525e08da156339e1558c1dd2d'

Monotone-Parent: 517b0b095f30f6f2f92a4da5dfe0155872190daa
Monotone-Parent: 5d7bbc47e52cef4525e08da156339e1558c1dd2d
Monotone-Revision: 3cb2fca087640ef420f86750a3bd9caf7c365b3b

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-09-27T18:27:03
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2011-09-27 18:27:03 +00:00
4 changed files with 15 additions and 0 deletions

View File

@@ -15,6 +15,9 @@
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];
}