From f1be9d827fca570198473c139d49b15263266e15 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 7 Aug 2008 16:07:43 +0000 Subject: [PATCH] Monotone-Parent: 1f91242358ebeca578ffc5dde26b559bab4046ca Monotone-Revision: 58ca9ef1246b86b1823a3325ab222fa6361a4604 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-08-07T16:07:43 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ SoObjects/SOGo/LDAPUserManager.m | 32 +++++++++++++++----------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c34e2dc3..2c92a5974 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-08-07 Wolfgang Sourdeau + * SoObjects/SOGo/LDAPUserManager.m ([LDAPUserManager + -fetchContactsMatching:filter]): fetch entries matching filter + only in addressbooks. + ([LDAPUserManager -fetchUsersMatching:filter]): same as above for + authentication sources only. + * SoObjects/Appointments/SOGoUserFolder+Appointments.m ([SOGoUserFolder -davCalendarUserAddressSet]): the addresses returned should be those of the owner and not of the current user. diff --git a/SoObjects/SOGo/LDAPUserManager.m b/SoObjects/SOGo/LDAPUserManager.m index fc49fc71b..e19cce700 100644 --- a/SoObjects/SOGo/LDAPUserManager.m +++ b/SoObjects/SOGo/LDAPUserManager.m @@ -499,22 +499,8 @@ static BOOL forceImapLoginWithEmail = NO; return newContacts; } -- (NSArray *) fetchContactsMatching: (NSString *) filter -{ - NSMutableArray *contacts; - NSEnumerator *ldapSources; - LDAPSource *currentSource; - - contacts = [NSMutableArray array]; - ldapSources = [sources objectEnumerator]; - while ((currentSource = [ldapSources nextObject])) - [contacts addObjectsFromArray: - [currentSource fetchContactsMatching: filter]]; - - return [self _compactAndCompleteContacts: [contacts objectEnumerator]]; -} - -- (NSArray *) fetchUsersMatching: (NSString *) filter +- (NSArray *) _fetchEntriesInSources: (NSArray *) sourcesList + matching: (NSString *) filter { NSMutableArray *contacts; NSEnumerator *ldapSources; @@ -522,7 +508,7 @@ static BOOL forceImapLoginWithEmail = NO; LDAPSource *currentSource; contacts = [NSMutableArray array]; - ldapSources = [[self authenticationSourceIDs] objectEnumerator]; + ldapSources = [sourcesList objectEnumerator]; while ((sourceID = [ldapSources nextObject])) { currentSource = [sources objectForKey: sourceID]; @@ -533,6 +519,18 @@ static BOOL forceImapLoginWithEmail = NO; return [self _compactAndCompleteContacts: [contacts objectEnumerator]]; } +- (NSArray *) fetchContactsMatching: (NSString *) filter +{ + return [self _fetchEntriesInSources: [self addressBookSourceIDs] + matching: filter]; +} + +- (NSArray *) fetchUsersMatching: (NSString *) filter +{ + return [self _fetchEntriesInSources: [self authenticationSourceIDs] + matching: filter]; +} + - (void) cleanupSources { NSEnumerator *userIDs;