Monotone-Parent: 9831fe16221b26d01357cd8dc0a4a0a9d3f418ed

Monotone-Revision: ebba4da6ea34dfe0e2ef6576595708fef8f31a5a

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-08-20T12:50:47
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-08-20 12:50:47 +00:00
parent 2e271ba1fa
commit dcb8b9a1bb
2 changed files with 24 additions and 16 deletions
+3
View File
@@ -1,5 +1,8 @@
2010-08-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* 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.
+21 -16
View File
@@ -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];