diff --git a/ChangeLog b/ChangeLog index 4a695cab0..291e7f52f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,17 @@ * UI/Scheduler/UIxCalListingActions.m ([UIxCalListingActions -eventsListAction]): added support for sorting events. +2007-12-06 Wolfgang Sourdeau + + * UI/MailerUI/UIxMailEditor.m ([UIxMailEditor -saveAction]) + ([UIxMailEditor -sendAction]): make sure that the attachments + having the same filename are correctly sequenced (ex: base.ext, + base-1.ext, base-2.ext). + + * SoObjects/Mailer/SOGoMailBodyPart.m ([SOGoMailBodyPart + -fetchBLOB]): added support for quoted-printable decoding. Also, + we return nil if the type is not supported. + 2007-12-05 Wolfgang Sourdeau * UI/Scheduler/UIxTaskEditor.m ([UIxTaskEditor -newAction]): diff --git a/SoObjects/Mailer/SOGoMailBodyPart.m b/SoObjects/Mailer/SOGoMailBodyPart.m index c60f34b9b..0ce0fcd7f 100644 --- a/SoObjects/Mailer/SOGoMailBodyPart.m +++ b/SoObjects/Mailer/SOGoMailBodyPart.m @@ -32,6 +32,7 @@ #import #import #import +#import #import #import @@ -209,16 +210,22 @@ static BOOL debugOn = NO; if (enc) { - enc = [enc uppercaseString]; + enc = [enc lowercaseString]; - if ([enc isEqualToString:@"BASE64"]) + if ([enc isEqualToString: @"base64"]) data = [data dataByDecodingBase64]; - else if ([enc isEqualToString:@"7BIT"]) + else if ([enc isEqualToString: @"quoted-printable"]) + data = [data dataByDecodingQuotedPrintableTransferEncoding]; + else if ([enc isEqualToString: @"7bit"] + || [enc isEqualToString: @"8bit"]) ; /* keep data as is */ // TODO: do we need to change encodings? else - [self errorWithFormat:@"unsupported encoding: %@", enc]; + { + data = nil; + [self errorWithFormat: @"unsupported encoding: %@", enc]; + } } - + return data; } diff --git a/UI/MailerUI/UIxMailEditor.m b/UI/MailerUI/UIxMailEditor.m index 31e33f02a..c9c41dc2c 100644 --- a/UI/MailerUI/UIxMailEditor.m +++ b/UI/MailerUI/UIxMailEditor.m @@ -67,6 +67,7 @@ /* these are for the inline attachment list */ NSString *attachmentName; NSArray *attachmentNames; + NSMutableArray *attachedFiles; } @end @@ -115,6 +116,7 @@ static NSArray *infoKeys = nil; [bcc release]; [attachmentName release]; [attachmentNames release]; + [attachedFiles release]; [super dealloc]; } @@ -262,6 +264,29 @@ static NSArray *infoKeys = nil; } /* actions */ +- (NSString *) _fixedFilename: (NSString *) filename +{ + NSString *newFilename, *baseFilename, *extension; + unsigned int variation; + + if (!attachedFiles) + attachedFiles = [NSMutableArray new]; + + newFilename = filename; + + baseFilename = [filename stringByDeletingPathExtension]; + extension = [filename pathExtension]; + variation = 0; + while ([attachedFiles containsObject: newFilename]) + { + variation++; + newFilename = [NSString stringWithFormat: @"%@-%d.%@", baseFilename, + variation, extension]; + } + [attachedFiles addObject: newFilename]; + + return newFilename; +} - (NSDictionary *) _scanAttachmentFilenamesInRequest: (id) httpBody { @@ -271,7 +296,7 @@ static NSArray *infoKeys = nil; unsigned int count, max; NGMimeBodyPart *part; NGMimeContentDispositionHeaderField *header; - NSString *mimeType; + NSString *mimeType, *filename; parts = [httpBody parts]; max = [parts count]; @@ -284,8 +309,9 @@ static NSArray *infoKeys = nil; [part headerForKey: @"content-disposition"]; mimeType = [(NGMimeType *) [part headerForKey: @"content-type"] stringValue]; + filename = [self _fixedFilename: [header filename]]; attachment = [NSDictionary dictionaryWithObjectsAndKeys: - [header filename], @"filename", + filename, @"filename", mimeType, @"mimetype", nil]; [filenames setObject: attachment forKey: [header name]]; } @@ -370,12 +396,12 @@ static NSArray *infoKeys = nil; { NSArray *a; - if (attachmentNames != nil) - return attachmentNames; - - a = [[self clientObject] fetchAttachmentNames]; - a = [a sortedArrayUsingSelector: @selector (compare:)]; - attachmentNames = [a copy]; + if (attachmentNames) + { + a = [[self clientObject] fetchAttachmentNames]; + a = [a sortedArrayUsingSelector: @selector (compare:)]; + attachmentNames = [a copy]; + } return attachmentNames; } diff --git a/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox b/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox index 1733b8969..31ccfc8c2 100644 --- a/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox +++ b/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox @@ -35,8 +35,6 @@ -
@@ -95,7 +93,6 @@ - diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index f80417717..054005e0a 100644 --- a/UI/WebServerResources/generic.js +++ b/UI/WebServerResources/generic.js @@ -920,7 +920,7 @@ function onSearchKeyDown(event) { if (event.keyCode == 13) { onSearchFormSubmit(); - event.preventDefault(); + preventDefault(event); } else this.timer = setTimeout("onSearchFormSubmit()", 1000);