diff --git a/ChangeLog b/ChangeLog index 212c91dda..1f675d5fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-03-30 Wolfgang Sourdeau + * SoObjects/Mailer/SOGoMailAccount.m ([SOGoMailAccount + -toManyRelationshipKeys]): don't put the predefined folders in the + list if they are returned by the server. + * UI/MailerUI/UIxMailTree.m ([UIxMailTree -flattenedNodes]): we no longer store the "flattenedBlocks" in a dictionary since the object will be deleted anyway and we don't need to put the folders diff --git a/SoObjects/Mailer/SOGoMailAccount.m b/SoObjects/Mailer/SOGoMailAccount.m index 8f70346bd..8a362fddf 100644 --- a/SoObjects/Mailer/SOGoMailAccount.m +++ b/SoObjects/Mailer/SOGoMailAccount.m @@ -100,12 +100,25 @@ static BOOL useAltNamespace = NO; return rootFolderNames; } -- (NSArray *)toManyRelationshipKeys { - NSArray *a, *b; - - a = [self additionalRootFolderNames]; - b = [[self imap4Connection] subfoldersForURL:[self imap4URL]]; - return [b count] > 0 ? [b arrayByAddingObjectsFromArray:a] : a; +- (NSArray *) toManyRelationshipKeys +{ + NSMutableArray *folders; + NSArray *imapFolders, *additionalFolders; + + folders = [NSMutableArray new]; + [folders autorelease]; + + imapFolders = [[self imap4Connection] subfoldersForURL: [self imap4URL]]; + additionalFolders = [self additionalRootFolderNames]; + if ([imapFolders count] > 0) + [folders addObjectsFromArray: imapFolders]; + if ([additionalFolders count] > 0) + { + [folders removeObjectsInArray: additionalFolders]; + [folders addObjectsFromArray: additionalFolders]; + } + + return folders; } /* identity */