From 007d1a966aa447b9923d502de369af7732f176fb Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 20 Mar 2009 21:37:07 +0000 Subject: [PATCH] Monotone-Parent: 1979e3cba1625ad972044ea67711850014bd8156 Monotone-Revision: 7cc314736d305ee7778315690bd8d1f0c506bef8 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-03-20T21:37:07 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ SoObjects/SOGo/SOGoParentFolder.m | 8 +++++++- UI/Contacts/UIxContactFoldersView.m | 12 +++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf576a1ba..3e75ef5cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-03-20 Wolfgang Sourdeau + * UI/Contacts/UIxContactFoldersView.m ([UIxContactFoldersView + -allContactSearchAction]): trap @"SOGoDBException" and return nil + in that case. + * SoObjects/SOGo/SOGoUserDefaults.m ([SOGoUserDefaults -jsonRepresentation]): return "{}" if values is nil (due to a DB connection error). diff --git a/SoObjects/SOGo/SOGoParentFolder.m b/SoObjects/SOGo/SOGoParentFolder.m index be05614be..5a64548e3 100644 --- a/SoObjects/SOGo/SOGoParentFolder.m +++ b/SoObjects/SOGo/SOGoParentFolder.m @@ -423,7 +423,13 @@ static SoSecurityManager *sm = nil; { error = [self initSubFolders]; if (error) - [error raise]; + { + /* We exceptionnally raise the exception here because doPROPFIND: + will not care for errors in its response from + toManyRelationShipKeys, which may in turn trigger the + disappearance of user folders in the SOGo extensions. */ + [error raise]; + } } // if (!!hasSubscribedSources) // [self _appendSubscribedSourcesIfNeeded]; diff --git a/UI/Contacts/UIxContactFoldersView.m b/UI/Contacts/UIxContactFoldersView.m index ba34a735c..a8d7f9247 100644 --- a/UI/Contacts/UIxContactFoldersView.m +++ b/UI/Contacts/UIxContactFoldersView.m @@ -202,7 +202,17 @@ withSearchOn: (NSString *) contact if ([searchText length] > 0) { //NSLog(@"Search all contacts: %@", searchText); - folders = [[self clientObject] subFolders]; + NS_DURING + folders = [[self clientObject] subFolders]; + NS_HANDLER + /* We need to specifically test for @"SOGoDBException", which is + raised explicitly in SOGoParentFolder. Any other exception should + be re-raised. */ + if ([[localException name] isEqualToString: @"SOGoDBException"]) + folders = nil; + else + [localException raise]; + NS_ENDHANDLER sortedFolders = [NSMutableArray arrayWithCapacity: [folders count]]; uniqueContacts = [NSMutableDictionary dictionary]; /* We first search in LDAP folders (in case of duplicated entries in GCS folders) */