From ed67384586e82f8cfd23bcd23538cf107ffe1470 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 31 May 2012 14:51:18 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: b5d91e74f183ad54e2362119b25b4556f810e3b6 Monotone-Revision: fa6f3f2b467eaa14a01fb8a7dc2aee1e5e4191da Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-05-31T14:51:18 --- ChangeLog | 5 ++++- SoObjects/Mailer/SOGoMailFolder.m | 2 +- UI/MailerUI/UIxMailEditor.m | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c90eff83e..83980e845 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,9 +6,12 @@ of attributes to SOPE. * Added patch from bug #1608. This add many more password schemes for SQL authentication. - * SoObject/Mailer/SOGoMailFolder.m (_readMailboxACL): we + * SoObject/Mailer/SOGoMailFolder.m (-_readMailboxACL): we now create the mailbox if we are trying to read ACL of a deleted mailbox. + * UI/MailerUI/UIxMailEditor.m (-personalContactInfos): we check + if the folder still exist and if the database isn't down + before performing any address books search operations. 2012-05-29 Francis Lachapelle diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index d453ba578..393588c3a 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -1220,7 +1220,7 @@ static NSString *defaultUserID = @"anyone"; // If the mailbox doesn't exist, we create it. That could happen if // a special mailbox (Drafts, Sent, Trash) is deleted from SOGo's web GUI // or if any other mailbox is deleted behind SOGo's back. - if ([mailboxACL isKindOf: [NSException class]]) + if ([mailboxACL isKindOfClass: [NSException class]]) { [[self imap4Connection] createMailbox: [[self imap4Connection] imap4FolderNameForURL: [self imap4URL]] atURL: [[self mailAccountFolder] imap4URL]]; diff --git a/UI/MailerUI/UIxMailEditor.m b/UI/MailerUI/UIxMailEditor.m index e10b02ac6..eed8745b2 100644 --- a/UI/MailerUI/UIxMailEditor.m +++ b/UI/MailerUI/UIxMailEditor.m @@ -422,8 +422,14 @@ static NSArray *infoKeys = nil; folderContainer = (SOGoContactFolders *) [[[self clientObject] lookupUserFolder] privateContacts: @"Contacts" inContext: nil]; + folder = [folderContainer lookupPersonalFolder: @"personal" ignoringRights: YES]; + // If the folder doesn't exist anymore or if the database is down, we + // return an empty array. + if ([folder isKindOfClass: [NSException class]]) + return [NSArray array]; + contactInfos = [folder lookupContactsWithFilter: nil onCriteria: nil sortBy: @"c_cn"