diff --git a/ChangeLog b/ChangeLog index 08939ad65..ba30b668a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2012-08-15 Wolfgang Sourdeau + * OpenChange/MAPIStoreMailFolder.m (-addProperties:): make use of + the new methods below when a mail folder has been renamed, as this + operation affects the url of mail objects. + * OpenChange/SOGoMAPIDBObject.m (-setNameInContainer): update the object record in the database to reflect the change of folder name. diff --git a/OpenChange/MAPIStoreMailFolder.m b/OpenChange/MAPIStoreMailFolder.m index c4c85c8ad..45e3c7c91 100644 --- a/OpenChange/MAPIStoreMailFolder.m +++ b/OpenChange/MAPIStoreMailFolder.m @@ -49,6 +49,7 @@ #import "MAPIStoreAppointmentWrapper.h" #import "MAPIStoreContext.h" #import "MAPIStoreFAIMessage.h" +#import "MAPIStoreMailContext.h" #import "MAPIStoreMailMessageTable.h" #import "MAPIStoreMapping.h" #import "MAPIStoreTypes.h" @@ -110,7 +111,7 @@ static Class SOGoMailFolderK, MAPIStoreMailFolderK, MAPIStoreOutboxFolderK; - (void) addProperties: (NSDictionary *) newProperties { - NSString *newDisplayName; + NSString *newDisplayName, *newNameInContainer; NSMutableDictionary *propsCopy; NSNumber *key; uint64_t fid; @@ -124,7 +125,12 @@ static Class SOGoMailFolderK, MAPIStoreMailFolderK, MAPIStoreOutboxFolderK; { fid = [self objectId]; [(SOGoMailFolder *) sogoObject renameTo: newDisplayName]; + newNameInContainer = [sogoObject nameInContainer]; + if (!container) + [(MAPIStoreMailContext *) context + updateURLWithFolderName: newNameInContainer]; [[self mapping] updateID: fid withURL: [self url]]; + [dbFolder setNameInContainer: newNameInContainer]; [self cleanupCaches]; propsCopy = [newProperties mutableCopy];