From f936d66b8dfa4a9ae10815c67ef4ff4a7d06f686 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 26 Oct 2006 16:34:25 +0000 Subject: [PATCH] Monotone-Parent: b2f62cdaa21cb716943261705698e2506dfcb55f Monotone-Revision: 3ea81af5e61dd4b624e4c1458d66bc7c0829da07 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-10-26T16:34:25 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/Contacts/UIxContactFoldersView.m | 19 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) 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"],