From 67720a01a0a92f38531b3b26b8202d4517bb9761 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 19 Aug 2010 19:22:08 +0000 Subject: [PATCH] Monotone-Parent: 5d6bd031d4a71e69a4759798355764f7f9894322 Monotone-Revision: 4b75d0f2673a649962c631fea2213e8dbf33a7b1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-19T19:22:08 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ SoObjects/Mailer/SOGoMailFolder.m | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3e0b0accc..2fc56fa93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-08-19 Wolfgang Sourdeau + * SoObjects/Mailer/SOGoMailFolder.m (-deleteUIDs:inContext:): make + the use of the "result" variable clearer by declaring it with a + proper class name and avoiding type confusion within the code. + * UI/WebServerResources/MailerUI.js: (initDnd): removed useless method. (onMessageListPrepareVisibility): fixed a bug where the current diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index e0b321eeb..e5e14f11d 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -271,7 +271,7 @@ static NSString *defaultUserID = @"anyone"; NGImap4Client *client; NSString *folderName; NSException *error; - id result; + NSString *result; BOOL b; trashFolder = [[self mailAccountFolder] trashFolderInContext: localContext]; @@ -296,19 +296,21 @@ static NSString *defaultUserID = @"anyone"; objectForKey: @"result"]; if (![result boolValue]) - result = [[self imap4Connection] createMailbox: folderName atURL: [[self mailAccountFolder] imap4URL]]; + [[self imap4Connection] createMailbox: folderName + atURL: [[self mailAccountFolder] imap4URL]]; + + result = [[client copyUids: uids toFolder: folderName] + objectForKey: @"result"]; - if (!result || [result boolValue]) - result = [client copyUids: uids toFolder: folderName]; - - b = [[result valueForKey: @"result"] boolValue]; + b = [result boolValue]; } if (b) { - result = [client storeFlags: [NSArray arrayWithObject: @"Deleted"] - forUIDs: uids addOrRemove: YES]; - if ([[result valueForKey: @"result"] boolValue]) + result = [[client storeFlags: [NSArray arrayWithObject: @"Deleted"] + forUIDs: uids addOrRemove: YES] + objectForKey: @"result"]; + if ([result boolValue]) { [self markForExpunge]; [trashFolder flushMailCaches];