diff --git a/ChangeLog b/ChangeLog index 17cf18a1e..b444eb5a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-10-26 Wolfgang Sourdeau + * UI/Contacts/UIxContactFoldersView.m ([UIxContactFoldersView + -_responseForResults:results]): give priority to results with + "c_uid" fields. If none returned, use the first contact received. + * OGoContentStore/OCSiCalFieldExtractor.m ([OCSiCalFieldExtractor -extractQuickFieldsFromEvent:_event]): changed "TENTATIVE" code to 2 and "CANCELLED" to 0. diff --git a/UI/Contacts/UIxContactFoldersView.m b/UI/Contacts/UIxContactFoldersView.m index f6bef241d..ee0cd04d1 100644 --- a/UI/Contacts/UIxContactFoldersView.m +++ b/UI/Contacts/UIxContactFoldersView.m @@ -127,6 +127,21 @@ return email; } +- (NSDictionary *) _nextResultWithUid: (NSEnumerator *) results +{ + NSDictionary *result, *possibleResult; + + result = nil; + possibleResult = [results nextObject]; + while (possibleResult && !result) + if ([[possibleResult objectForKey: @"c_uid"] length]) + result = possibleResult; + else + possibleResult = [results nextObject]; + + return result; +} + - (WOResponse *) _responseForResults: (NSArray *) results { WOResponse *response; @@ -137,7 +152,9 @@ if ([results count]) { - result = [results objectAtIndex: 0]; + result = [self _nextResultWithUid: [results objectEnumerator]]; + if (!result) + result = [results objectAtIndex: 0]; email = [self _emailForResult: result]; responseString = [NSString stringWithFormat: @"%@:%@", [result objectForKey: @"c_uid"],