From dcb8b9a1bb15f89a88ca9f8b0b0420a92d4c79a8 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 20 Aug 2010 12:50:47 +0000 Subject: [PATCH] Monotone-Parent: 9831fe16221b26d01357cd8dc0a4a0a9d3f418ed Monotone-Revision: ebba4da6ea34dfe0e2ef6576595708fef8f31a5a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-20T12:50:47 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 ++ SoObjects/Contacts/SOGoContactFolders.m | 37 ++++++++++++++----------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 587378a53..1e0815c3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2010-08-20 Wolfgang Sourdeau + * SoObjects/Contacts/SOGoContactFolders.m (-appendSystemSources): + append nothing if used from an iPhone. + * SoObjects/SOGo/SOGoParentFolder.m (-appendPersonalSources): we now that "owner" is always set properly from the init methods, no need to invoke ownerInContext: anymore. diff --git a/SoObjects/Contacts/SOGoContactFolders.m b/SoObjects/Contacts/SOGoContactFolders.m index 6c791ba5b..189326215 100644 --- a/SoObjects/Contacts/SOGoContactFolders.m +++ b/SoObjects/Contacts/SOGoContactFolders.m @@ -61,28 +61,33 @@ SOGoContactSourceFolder *currentFolder; SOGoUser *currentUser; - currentUser = [context activeUser]; - if (activeUserIsOwner - || [[currentUser login] - isEqualToString: [self ownerInContext: context]]) + if (![[context request] isIPhoneAddressBookApp]) { - domain = [currentUser domain]; - um = [SOGoUserManager sharedUserManager]; - sourceIDs = [[um addressBookSourceIDsInDomain: domain] objectEnumerator]; - while ((currentSourceID = [sourceIDs nextObject])) + currentUser = [context activeUser]; + if (activeUserIsOwner + || [[currentUser login] isEqualToString: owner]) { - srcDisplayName = [um displayNameForSourceWithID: currentSourceID]; - currentFolder = [SOGoContactSourceFolder folderWithName: currentSourceID - andDisplayName: srcDisplayName - inContainer: self]; - [currentFolder setSource: [um sourceWithID: currentSourceID]]; - [subFolders setObject: currentFolder forKey: currentSourceID]; + domain = [currentUser domain]; + um = [SOGoUserManager sharedUserManager]; + sourceIDs = [[um addressBookSourceIDsInDomain: domain] + objectEnumerator]; + while ((currentSourceID = [sourceIDs nextObject])) + { + srcDisplayName + = [um displayNameForSourceWithID: currentSourceID]; + currentFolder = [SOGoContactSourceFolder + folderWithName: currentSourceID + andDisplayName: srcDisplayName + inContainer: self]; + [currentFolder setSource: [um sourceWithID: currentSourceID]]; + [subFolders setObject: currentFolder forKey: currentSourceID]; + } } } return nil; } - + - (NSString *) defaultFolderName { return [self labelForKey: @"Personal Address Book"]; @@ -92,7 +97,7 @@ { NSMutableArray *keys; - if ([[context request] isAddressBookApp]) + if ([[context request] isMacOSXAddressBookApp]) keys = [NSMutableArray arrayWithObject: @"personal"]; else keys = (NSMutableArray *) [super toManyRelationshipKeys];