+- (NSArray *)_fetchCoreInfosForUIDs:(NSArray *)_uids
+ uniqueWithSet:(NSMutableSet *)_uniquer
+{
+ NSMutableArray *ma;
+ unsigned i, count;
+
+ count = [_uids count];
+ ma = [NSMutableArray arrayWithCapacity:count * 10];
+
+ for (i = 0; i < count; i++) {
+ OCSFolder *folder;
+ NSString *path;
+ NSString *uid;
+ NSArray *res;
+
+ uid = [_uids objectAtIndex:i];
+ if ([uid length] == 0) continue;
+
+ path = [[@"/Users/" stringByAppendingString:uid]
+ stringByAppendingString:@"/Calendar"];
+
+ if ((folder = [[self clientObject] ocsFolderForPath:path]) == nil) {
+ [self logWithFormat:@"ERROR: did not find user: %@", uid];
+ continue;
+ }
+
+ res = [[self clientObject] fetchCoreInfosFromFolder:folder
+ from:[self startDate] to:[self endDate]];
+ if (res == nil) {
+ [self logWithFormat:@"ERROR: fetch failed for user: %@", uid];
+ continue;
+ }
+
+ /* perform uniquing */
+ {
+ int j, rcount;
+
+ for (j = 0, rcount = [res count]; j < rcount; j++) {
+ NSDictionary *record;
+
+ record = [res objectAtIndex:j];
+
+ if ([_uniquer containsObject:[record valueForKey:@"uid"]])
+ continue;
+
+ [ma addObject:record];
+ [_uniquer addObject:[record valueForKey:@"uid"]];
+ }
+ }
+ }
+ return ma;
+}
+