From 2388f300937820c3c7206a4e771cc28cb287a9b6 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 4 Mar 2009 14:41:00 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: b650569887c118b01da27c8339a401335419846c Monotone-Revision: cf83f210bd51772341ff7ea082a7e6bd95fc4bea Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2009-03-04T14:41:00 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ SoObjects/Mailer/SOGoMailObject+Draft.m | 26 +++++++++++-------------- SoObjects/SOGo/NSArray+Utilities.m | 2 +- 3 files changed, 18 insertions(+), 16 deletions(-) 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 *