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;