From b0374af51d956a86fa2288ebf1075e87e8d97489 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 28 Sep 2010 15:07:27 +0000 Subject: [PATCH] Monotone-Parent: acf6003d2dca73186ecece884f034aee4351372c Monotone-Revision: 9e946c46691afd745f601eae3b1973a26f7494e4 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-09-28T15:07:27 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ UI/MailerUI/UIxMailFolderActions.m | 27 +++++++++------------------ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 028f80cbf..8ad4a64e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2010-09-28 Wolfgang Sourdeau + * UI/MailerUI/UIxMailFolderActions.m (-createFolderAction): + modified to make use of -[SOGoMailFolder create]. + * SoObjects/Mailer/SOGoMailObject.m (-displayName): new accessor. * SoObjects/Mailer/SOGoMailFolder.m (-displayName): fixed accessor diff --git a/UI/MailerUI/UIxMailFolderActions.m b/UI/MailerUI/UIxMailFolderActions.m index 45a45dd69..3b55cf9cf 100644 --- a/UI/MailerUI/UIxMailFolderActions.m +++ b/UI/MailerUI/UIxMailFolderActions.m @@ -53,35 +53,26 @@ - (WOResponse *) createFolderAction { - SOGoMailFolder *co; + SOGoMailFolder *co, *newFolder; WOResponse *response; - NGImap4Connection *connection; - NSException *error; - NSString *folderName, *path; + NSString *folderName; co = [self clientObject]; folderName = [[context request] formValueForKey: @"name"]; if ([folderName length] > 0) { - connection = [co imap4Connection]; - error = [connection createMailbox: folderName atURL: [co imap4URL]]; - if (error) + newFolder + = [co lookupName: [NSString stringWithFormat: @"folder%@", folderName] + inContext: context + acquire: NO]; + if ([newFolder create]) + response = [self responseWith204]; + else { response = [self responseWithStatus: 500]; [response appendContentString: @"Unable to create folder."]; } - else - { - if ([co respondsToSelector: @selector (absoluteImap4Name)]) - path = [NSString stringWithFormat: @"%@%@", - [co absoluteImap4Name], folderName]; - else - path = folderName; - [[connection client] subscribe: path]; - - response = [self responseWith204]; - } } else {