From 927d3630b9c5384d1aae70d07cf1b52f63374e8e Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 30 Mar 2007 15:25:20 +0000 Subject: [PATCH] Monotone-Parent: 92e42146654f909620b7da66ba2c0605408e6a38 Monotone-Revision: 7520c3f3ca840f0f1b0b386fd6a8262877b672ba Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-03-30T15:25:20 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ SoObjects/Mailer/SOGoMailAccount.m | 25 +++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) 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 */