diff --git a/ChangeLog b/ChangeLog index bfa5a5120..f8496b16d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ * OpenChange/MAPIStoreMailFolder.m (-moveCopyToFolder:withNewName:isMove:isRecursive:): implemented IMAP-based copy operation, for speed. + (-addProperties): restored the ability to rename IMAP folders by + properly updating the fid/url mapping with our new methods. 2012-08-14 Wolfgang Sourdeau diff --git a/OpenChange/MAPIStoreMailFolder.m b/OpenChange/MAPIStoreMailFolder.m index deaef0c15..c4c85c8ad 100644 --- a/OpenChange/MAPIStoreMailFolder.m +++ b/OpenChange/MAPIStoreMailFolder.m @@ -113,6 +113,7 @@ static Class SOGoMailFolderK, MAPIStoreMailFolderK, MAPIStoreOutboxFolderK; NSString *newDisplayName; NSMutableDictionary *propsCopy; NSNumber *key; + uint64_t fid; key = MAPIPropertyKey (PR_DISPLAY_NAME_UNICODE); newDisplayName = [newProperties objectForKey: key]; @@ -121,10 +122,11 @@ static Class SOGoMailFolderK, MAPIStoreMailFolderK, MAPIStoreOutboxFolderK; && ![[(SOGoMailFolder *) sogoObject displayName] isEqualToString: newDisplayName]) { - [NSException raise: @"MAPIStoreIOException" - format: @"renaming a mail folder via OpenChange is" - @" currently a bad idea"]; + fid = [self objectId]; [(SOGoMailFolder *) sogoObject renameTo: newDisplayName]; + [[self mapping] updateID: fid withURL: [self url]]; + [self cleanupCaches]; + propsCopy = [newProperties mutableCopy]; [propsCopy removeObjectForKey: key]; [propsCopy autorelease];