diff --git a/OpenChange/MAPIStoreDBFolder.m b/OpenChange/MAPIStoreDBFolder.m index ec7207062..798af041b 100644 --- a/OpenChange/MAPIStoreDBFolder.m +++ b/OpenChange/MAPIStoreDBFolder.m @@ -152,7 +152,8 @@ static NSString *MAPIStoreRightFolderContact = @"RightsFolderContact"; targetPath = [[targetFolder sogoObject] path]; newPath = [NSString stringWithFormat: @"%@/%@", targetPath, pathComponent]; - [dbFolder changePathTo: newPath]; + [dbFolder changePathTo: newPath + intoNewContainer: [targetFolder dbFolder]]; mapping = [self mapping]; newURL = [NSString stringWithFormat: @"%@%@/", diff --git a/OpenChange/MAPIStoreMailFolder.m b/OpenChange/MAPIStoreMailFolder.m index b8fae1e71..69f235783 100644 --- a/OpenChange/MAPIStoreMailFolder.m +++ b/OpenChange/MAPIStoreMailFolder.m @@ -1286,7 +1286,8 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP) [dbFolder changePathTo: [NSString stringWithFormat: @"%@/folder%@", parentDBFolderPath, - newFolderDBName]]; + newFolderDBName] + intoNewContainer: [targetFolder dbFolder]]; } } else diff --git a/SoObjects/SOGo/SOGoCacheGCSFolder.h b/SoObjects/SOGo/SOGoCacheGCSFolder.h index 1b63ae683..3495dc0d6 100644 --- a/SoObjects/SOGo/SOGoCacheGCSFolder.h +++ b/SoObjects/SOGo/SOGoCacheGCSFolder.h @@ -49,6 +49,8 @@ andSortOrderings: (NSArray *) sortOrderings; - (void) changePathTo: (NSString *) newPath; +- (void) changePathTo: (NSString *) newPath + intoNewContainer: (id) newContainer; @end diff --git a/SoObjects/SOGo/SOGoCacheGCSFolder.m b/SoObjects/SOGo/SOGoCacheGCSFolder.m index f8d25d381..b29287fcb 100644 --- a/SoObjects/SOGo/SOGoCacheGCSFolder.m +++ b/SoObjects/SOGo/SOGoCacheGCSFolder.m @@ -308,6 +308,14 @@ Class SOGoCacheGCSObjectK = Nil; [super changePathTo: newPath]; } +- (void) changePathTo: (NSString *) newPath intoNewContainer: (id) newContainer +{ + [self changePathTo: newPath]; + container = newContainer; + if ([self doesRetainContainer]) + [container retain]; +} + // - (NSArray *) toOneRelationshipKeysMatchingQualifier: (EOQualifier *) qualifier // andSortOrderings: (NSArray *) sortOrderings // { diff --git a/SoObjects/SOGo/SOGoObject.h b/SoObjects/SOGo/SOGoObject.h index 114b0c55d..dafd5f06e 100644 --- a/SoObjects/SOGo/SOGoObject.h +++ b/SoObjects/SOGo/SOGoObject.h @@ -82,6 +82,8 @@ - (BOOL) isInPublicZone; +- (BOOL) doesRetainContainer; + /* accessors */ - (void) setContext: (WOContext *) newContext;