diff --git a/ChangeLog b/ChangeLog index af3c13944..ca9815116 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ * SoObjects/SOGo/SOGoGCSFolder.m: Remove color from user settings on unsubscribe. + * UI/MailerUI/UIxMailFolderActions.m (_trashedURLOfFolder:withCO:): Fixed + issue when deleting a folder with the same name as one already in the Trash. 2009-06-30 Wolfgang Sourdeau diff --git a/UI/MailerUI/UIxMailFolderActions.m b/UI/MailerUI/UIxMailFolderActions.m index 27a381d4a..81a056d1c 100644 --- a/UI/MailerUI/UIxMailFolderActions.m +++ b/UI/MailerUI/UIxMailFolderActions.m @@ -139,13 +139,33 @@ withCO: (SOGoMailFolder *) co { NSURL *destURL; - NSString *trashFolderName, *folderName, *path; + NSString *trashFolderName, *folderName, *path, *testPath; + NGImap4Connection *connection; + int i = 1; + id test; + + connection = [co imap4Connection]; folderName = [[srcURL path] lastPathComponent]; trashFolderName = [[co mailAccountFolder] trashFolderNameInContext: context]; path = [NSString stringWithFormat: @"/%@/%@", trashFolderName, folderName]; + testPath = path; + while ( i < 10 ) + { + test = [[connection client] select: testPath]; + if (test && [[test objectForKey: @"result"] boolValue]) + { + testPath = [NSString stringWithFormat: @"%@%x", path, i]; + i++; + } + else + { + path = testPath; + break; + } + } destURL = [[NSURL alloc] initWithScheme: [srcURL scheme] host: [srcURL host] path: path]; [destURL autorelease];