diff --git a/ChangeLog b/ChangeLog index 8ed4b02a3..826341e3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-03-04 Ludovic Marcotte + + * Fixed a small issue when fetching parts where + the encoding could be nil and subsequently, the + path couldn't be set. + 2009-03-03 Ludovic Marcotte * Fixed various small issues with the SOGo diff --git a/SoObjects/Mailer/SOGoMailObject+Draft.m b/SoObjects/Mailer/SOGoMailObject+Draft.m index 723f9ced2..b527e092d 100644 --- a/SoObjects/Mailer/SOGoMailObject+Draft.m +++ b/SoObjects/Mailer/SOGoMailObject+Draft.m @@ -243,9 +243,8 @@ currentFile = [NSDictionary dictionaryWithObjectsAndKeys: filename, @"filename", [mimeType lowercaseString], @"mimetype", - [part - objectForKey: @"encoding"], @"encoding", - path, @"path", nil]; + path, @"path", + [part objectForKey: @"encoding"], @"encoding", nil]; [keys addObject: currentFile]; } } @@ -254,29 +253,26 @@ intoArray: (NSMutableArray *) keys withPath: (NSString *) path { - NSEnumerator *subparts; - NSString *type; - unsigned int count; - NSDictionary *currentPart; + NSMutableDictionary *currentPart; NSString *newPath; + NSArray *subparts; + NSString *type; + unsigned int i; type = [[part objectForKey: @"type"] lowercaseString]; if ([type isEqualToString: @"multipart"]) { - subparts = [[part objectForKey: @"parts"] objectEnumerator]; - currentPart = [subparts nextObject]; - count = 1; - while (currentPart) + subparts = [part objectForKey: @"parts"]; + for (i = 1; i <= [subparts count]; i++) { + currentPart = [subparts objectAtIndex: i-1]; if (path) - newPath = [NSString stringWithFormat: @"%@.%d", path, count]; + newPath = [NSString stringWithFormat: @"%@.%d", path, i]; else - newPath = [NSString stringWithFormat: @"%d", count]; + newPath = [NSString stringWithFormat: @"%d", i]; [self _fetchFileAttachmentKeysInPart: currentPart intoArray: keys withPath: newPath]; - currentPart = [subparts nextObject]; - count++; } } else diff --git a/SoObjects/SOGo/NSArray+Utilities.m b/SoObjects/SOGo/NSArray+Utilities.m index 5cbb720f0..70bc416d0 100644 --- a/SoObjects/SOGo/NSArray+Utilities.m +++ b/SoObjects/SOGo/NSArray+Utilities.m @@ -1,6 +1,6 @@ /* NSArray+Utilities.m - this file is part of SOGo * - * Copyright (C) 2006 Inverse inc. + * Copyright (C) 2006-2009 Inverse inc. * * Author: Wolfgang Sourdeau *