From ab001192d668f77b9878900eaf781faebfa85241 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 15 Aug 2012 15:24:42 +0000 Subject: [PATCH] Monotone-Parent: 85e37dbc7e87a173193494e6234f460788904318 Monotone-Revision: 107e4e5ebd41e916769f1be7ce070d725d255f0d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-08-15T15:24:42 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 2 ++ OpenChange/MAPIStoreMailFolder.m | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) 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];