diff --git a/SoObjects/Contacts/SOGoContactGCSFolder.m b/SoObjects/Contacts/SOGoContactGCSFolder.m index 1a58723dd..26e0e974c 100644 --- a/SoObjects/Contacts/SOGoContactGCSFolder.m +++ b/SoObjects/Contacts/SOGoContactGCSFolder.m @@ -25,8 +25,10 @@ #import #import #import +#import #import #import +#import #import #import #import @@ -103,7 +105,6 @@ if (filter && [filter length] > 0) { -#warning why we do not use %%%@%% everywhere? qs = [NSString stringWithFormat: @"(c_sn isCaseInsensitiveLike: '%@%%') OR " @"(c_givenname isCaseInsensitiveLike: '%@%%') OR " @@ -195,7 +196,6 @@ NSMutableDictionary *filterData; id parentNode; id ranges; - NSString *componentName; parentNode = [filterElement parentNode]; @@ -244,34 +244,6 @@ return filters; } -- (void) _appendComponentsMatchingFilters: (NSArray *) filters - toResponse: (WOResponse *) response -{ - unsigned int count, max; - NSDictionary *currentFilter, *contact; - NSEnumerator *contacts; - NSString *baseURL; - - baseURL = [self baseURLInContext: context]; - - max = [filters count]; - for (count = 0; count < max; count++) - { - currentFilter = [filters objectAtIndex: count]; - contacts = [[self lookupContactsWithFilter: [[currentFilter allValues] lastObject] - sortBy: @"c_givenname" - ordering: NSOrderedDescending] - objectEnumerator]; - - while ((contact = [contacts nextObject])) - { - [self appendObject: contact - withBaseURL: baseURL - toREPORTResponse: response]; - } - } -} - - (void) appendObject: (NSDictionary *) object withBaseURL: (NSString *) baseURL toREPORTResponse: (WOResponse *) r @@ -308,6 +280,34 @@ [r appendContentString: @" \r\n"]; } +- (void) _appendComponentsMatchingFilters: (NSArray *) filters + toResponse: (WOResponse *) response +{ + unsigned int count, max; + NSDictionary *currentFilter, *contact; + NSEnumerator *contacts; + NSString *baseURL; + + baseURL = [self baseURLInContext: context]; + + max = [filters count]; + for (count = 0; count < max; count++) + { + currentFilter = [filters objectAtIndex: count]; + contacts = [[self lookupContactsWithFilter: [[currentFilter allValues] lastObject] + sortBy: @"c_givenname" + ordering: NSOrderedDescending] + objectEnumerator]; + + while ((contact = [contacts nextObject])) + { + [self appendObject: contact + withBaseURL: baseURL + toREPORTResponse: response]; + } + } +} + - (NSArray *) lookupContactsWithFilter: (NSString *) filter sortBy: (NSString *) sortKey ordering: (NSComparisonResult) sortOrdering