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 {