Monotone-Parent: 2fea5fbc833aa109f5048dda8ddd9884c91385e1

Monotone-Revision: 3227626c75075b7ce019ef85ce3b7ddbd4c461f7

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-08-13T03:58:14
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2012-08-13 03:58:14 +00:00
parent 9b5e7360d0
commit 9ec0b9d3d6
2 changed files with 19 additions and 2 deletions

View File

@ -1,5 +1,11 @@
2012-08-12 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreMailFolder.m (-moveToFolder:withName:): if
the new name is not provided (unlikely), the computed new name
must not have the "folder" prefix.
We now also make use of -[MAPIStoreMapping updateID:withURL:] to
change the references in the mapping database.
* OpenChange/MAPIStoreFolder.m (-objectId): folder keys always end
with a "/" by convention.

View File

@ -1009,13 +1009,16 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
enum mapistore_error rc;
NSURL *folderURL, *newFolderURL;
SOGoMailFolder *targetSOGoFolder;
NSString *newURL;
NSException *error;
MAPIStoreMapping *mapping;
if ([targetFolder isKindOfClass: MAPIStoreMailFolderK])
{
folderURL = [sogoObject imap4URL];
if (!newFolderName)
newFolderName = [sogoObject nameInContainer];
newFolderName = [[sogoObject nameInContainer]
substringFromIndex: 6]; /* length of "folder" */
targetSOGoFolder = [targetFolder sogoObject];
newFolderURL = [NSURL URLWithString: newFolderName
relativeToURL: [targetSOGoFolder imap4URL]];
@ -1025,7 +1028,15 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
if (error)
rc = MAPISTORE_ERR_DENIED;
else
rc = MAPISTORE_SUCCESS;
{
rc = MAPISTORE_SUCCESS;
mapping = [self mapping];
newURL = [NSString stringWithFormat: @"%@folder%@/",
[targetFolder url],
[newFolderName stringByEscapingURL]];
[mapping updateID: [self objectId]
withURL: newURL];
}
}
else
rc = MAPISTORE_ERR_DENIED;