From a90afadebca2351a08047db6c293d887de5e72cd Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 15 Aug 2011 19:10:56 +0000 Subject: [PATCH] Monotone-Parent: 360795eba52fb9152f5379fc602e210022498ae1 Monotone-Revision: 62917484785e9ce38f416c25ad860a0f28f415b0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-08-15T19:10:56 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ SoObjects/Mailer/SOGoMailAccount.h | 1 + SoObjects/Mailer/SOGoMailAccount.m | 22 +++++++++++++++++++--- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e48fa0fdb..eccb60edb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-08-15 Wolfgang Sourdeau + * SoObjects/Mailer/SOGoMailAccount.m + (-toManyRelationshipKeysWithNamespaces:): new method, superseding + "toManyRelationshipKeys" that enables the returning of namespaces + "folders" or not. + * OpenChange/MAPIStoreMailMessage.m (-objectVersion): updated code as in MAPIStoreGCSMessage's version. diff --git a/SoObjects/Mailer/SOGoMailAccount.h b/SoObjects/Mailer/SOGoMailAccount.h index 6ad08bb42..bec7a5e9e 100644 --- a/SoObjects/Mailer/SOGoMailAccount.h +++ b/SoObjects/Mailer/SOGoMailAccount.h @@ -77,6 +77,7 @@ typedef enum { - (NSString *) encryption; /* folder pathes */ +- (NSArray *) toManyRelationshipKeysWithNamespaces: (BOOL) withNSs; - (NSArray *) allFolderPaths; - (BOOL) isInDraftsFolder; diff --git a/SoObjects/Mailer/SOGoMailAccount.m b/SoObjects/Mailer/SOGoMailAccount.m index f948942ec..6a3bd5c24 100644 --- a/SoObjects/Mailer/SOGoMailAccount.m +++ b/SoObjects/Mailer/SOGoMailAccount.m @@ -174,21 +174,37 @@ static NSString *inboxFolderName = @"INBOX"; return [self _namespacesWithKey: @"shared"]; } -- (NSArray *) toManyRelationshipKeys +- (NSArray *) toManyRelationshipKeysWithNamespaces: (BOOL) withNSs { NSMutableArray *folders; - NSArray *imapFolders; + NSArray *imapFolders, *nss; imapFolders = [[self imap4Connection] subfoldersForURL: [self imap4URL]]; folders = [imapFolders mutableCopy]; [folders autorelease]; [folders addObjectUniquely: [self draftsFolderNameInContext: nil]]; - [self _appendNamespaces: folders]; + if (withNSs) + [self _appendNamespaces: folders]; + else + { /* some implementation insist on returning NSs in the list of + folders... */ + nss = [self otherUsersFolderNamespaces]; + if (nss) + [folders removeObjectsInArray: nss]; + nss = [self sharedFolderNamespaces]; + if (nss) + [folders removeObjectsInArray: nss]; + } return [[folders stringsWithFormat: @"folder%@"] resultsOfSelector: @selector (asCSSIdentifier)]; } +- (NSArray *) toManyRelationshipKeys +{ + return [self toManyRelationshipKeysWithNamespaces: YES]; +} + - (SOGoIMAPAclStyle) imapAclStyle { SOGoDomainDefaults *dd;