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];