diff --git a/ChangeLog b/ChangeLog index 006b62f20..42f210667 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-02-18 Ludovic Marcotte + + * UI/MailerUI/UIxMailFolderActions.m: Modified the + code so that we correctly subscribe/unsubscribe to + the folders (old/new) when renaming or deleting + a folder. Also corrected the creation of subfolders + by using -absoluteImap4Name. + 2010-02-18 Wolfgang Sourdeau * SoObjects/Appointments/SOGoCalendarComponent.m diff --git a/UI/MailerUI/UIxMailFolderActions.m b/UI/MailerUI/UIxMailFolderActions.m index 6c9f4d9fa..6e63b3668 100644 --- a/UI/MailerUI/UIxMailFolderActions.m +++ b/UI/MailerUI/UIxMailFolderActions.m @@ -69,8 +69,9 @@ else { path = [NSString stringWithFormat: @"%@%@", - [[co imap4URL] path], folderName]; - [[connection client] subscribe: path]; + [co absoluteImap4Name], folderName]; + [[connection client] subscribe: path]; + response = [self responseWith204]; } } @@ -123,13 +124,23 @@ [[connection client] select: [inbox absoluteImap4Name]]; error = [connection moveMailboxAtURL: srcURL toURL: destURL]; + if (error) { response = [self responseWithStatus: 500]; [response appendContentString: @"Unable to rename folder."]; } else - response = [self responseWith204]; + { + // We unsubscribe to the old one, and subscribe back to the new one + if ([[[context activeUser] userDefaults] mailShowSubscribedFoldersOnly]) + { + [[connection client] subscribe: [destURL path]]; + [[connection client] unsubscribe: [srcURL path]]; + } + + response = [self responseWith204]; + } } else { @@ -200,7 +211,16 @@ [response appendContentString: @"Unable to move folder."]; } else - response = [self responseWith204]; + { + // We unsubscribe to the old one, and subscribe back to the new one + if ([[[context activeUser] userDefaults] mailShowSubscribedFoldersOnly]) + { + [[connection client] subscribe: [destURL path]]; + [[connection client] unsubscribe: [srcURL path]]; + } + + response = [self responseWith204]; + } return response; }