From 28f66c6fd9407fa69a99511bfe6b7839de368f3f Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Tue, 20 Nov 2012 20:29:27 -0500 Subject: [PATCH] We correctly use
instead of \n when handling the signature. This happens when using HTML composition, instead of plain/text. --- SoObjects/Mailer/SOGoDraftObject.m | 13 ++++++++----- SoObjects/Mailer/SOGoMailForward.m | 12 ++++++++---- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/SoObjects/Mailer/SOGoDraftObject.m b/SoObjects/Mailer/SOGoDraftObject.m index 709643f80..21a31e4da 100644 --- a/SoObjects/Mailer/SOGoDraftObject.m +++ b/SoObjects/Mailer/SOGoDraftObject.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2007-2010 Inverse inc. + Copyright (C) 2007-2012 Inverse inc. Copyright (C) 2004-2005 SKYRIX Software AG This file is part of SOGo. @@ -804,8 +804,8 @@ static NSString *userAgent = nil; - (void) fetchMailForForwarding: (SOGoMailObject *) sourceMail { NSDictionary *info, *attachment; + NSString *signature, *nl; SOGoUserDefaults *ud; - NSString *signature; [sourceMail fetchCoreInfos]; @@ -831,11 +831,14 @@ static NSString *userAgent = nil; } else { - // TODO: use subject for filename? -// error = [newDraft saveAttachment:content withName:@"forward.eml"]; + // TODO: use subject for filename? + // error = [newDraft saveAttachment:content withName:@"forward.eml"]; signature = [[self mailAccountFolder] signature]; if ([signature length]) - [self setText: [NSString stringWithFormat: @"\n-- \n%@", signature]]; + { + nl = (isHTML ? @"
" : @"\n"); + [self setText: [NSString stringWithFormat: @"%@-- %@%@", nl, nl, signature]]; + } attachment = [NSDictionary dictionaryWithObjectsAndKeys: [sourceMail filenameForForward], @"filename", @"message/rfc822", @"mimetype", diff --git a/SoObjects/Mailer/SOGoMailForward.m b/SoObjects/Mailer/SOGoMailForward.m index c3fba3007..9beca2887 100644 --- a/SoObjects/Mailer/SOGoMailForward.m +++ b/SoObjects/Mailer/SOGoMailForward.m @@ -1,6 +1,6 @@ /* SOGoMailForward.m - this file is part of SOGo * - * Copyright (C) 2007 Inverse inc. + * Copyright (C) 2007-2012 Inverse inc. * * Author: Wolfgang Sourdeau * @@ -226,11 +226,15 @@ - (NSString *) signature { - NSString *signature, *mailSignature; - + NSString *signature, *mailSignature, *nl; + signature = [[sourceMail mailAccountFolder] signature]; + if ([signature length]) - mailSignature = [NSString stringWithFormat: @"-- \n%@", signature]; + { + nl = (htmlComposition ? @"
" : @"\n"); + mailSignature = [NSString stringWithFormat: @"-- %@%@", nl, signature]; + } else mailSignature = @"";