From d5af9f3d86d032e481101aea8614614d0ffd711d Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 18 Feb 2010 20:01:12 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 2e584005bb3d904920fa4bd08e149b6029d41c59 Monotone-Revision: dad4b61f6a15f4d008df898e890a7b7f753c94e9 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-02-18T20:01:12 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 8 ++++++++ UI/MailerUI/UIxMailFolderActions.m | 28 ++++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 4 deletions(-) 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; }