diff --git a/ChangeLog b/ChangeLog index 1f12a81d7..2a7273d57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2012-08-12 Wolfgang Sourdeau + * 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. diff --git a/OpenChange/MAPIStoreMailFolder.m b/OpenChange/MAPIStoreMailFolder.m index 01907accb..a415a814e 100644 --- a/OpenChange/MAPIStoreMailFolder.m +++ b/OpenChange/MAPIStoreMailFolder.m @@ -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;