From 3efe64c3bc0240d07165475cb05fa74c901b5054 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 6 Dec 2007 15:55:44 +0000 Subject: [PATCH 1/4] Monotone-Parent: 072d560619f22b78e92501eb17c779b5ce668cac Monotone-Revision: f06d019c1d6083957b4e808d0f785dc63afb52fd Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-12-06T15:55:44 Monotone-Branch: ca.inverse.sogo --- UI/Templates/ContactsUI/UIxContactsListViewContainer.wox | 3 --- 1 file changed, 3 deletions(-) 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 @@ - From 9e95869243ba15c35cb70336d363f3688c919614 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 6 Dec 2007 16:03:53 +0000 Subject: [PATCH 2/4] Monotone-Parent: f06d019c1d6083957b4e808d0f785dc63afb52fd Monotone-Revision: c876bc15eeddfe59f4ede0428eb109b94086ffdb Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-12-06T16:03:53 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ SoObjects/Mailer/SOGoMailBodyPart.m | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index af43fe950..dbd07c7f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-12-06 Wolfgang Sourdeau + + * 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; } From 3debc96a59db54dc19ca15104f3d5ee021f3df16 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 6 Dec 2007 16:04:23 +0000 Subject: [PATCH 3/4] Monotone-Parent: c876bc15eeddfe59f4ede0428eb109b94086ffdb Monotone-Revision: f4db30ef74d0df8b212b89bceeb05e6dd3c57874 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-12-06T16:04:23 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/generic.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index 6313cd2ea..51e8ead99 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); From 8a4b14a0384833d9e73dff454638e94e47700a18 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 6 Dec 2007 16:27:28 +0000 Subject: [PATCH 4/4] Monotone-Parent: f4db30ef74d0df8b212b89bceeb05e6dd3c57874 Monotone-Revision: c4ca1fc9171a84aed3074955c7d96c02bf3ae9ad Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-12-06T16:27:28 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ UI/MailerUI/UIxMailEditor.m | 42 ++++++++++++++++++++++++++++++------- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index dbd07c7f4..14301de33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 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. 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; }