We correctly use <br/> instead of \n when handling the signature.

This happens when using HTML composition, instead of plain/text.
This commit is contained in:
Ludovic Marcotte
2012-11-20 20:29:27 -05:00
parent cc98664d13
commit 28f66c6fd9
2 changed files with 16 additions and 9 deletions

View File

@@ -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 ? @"<br/>" : @"\n");
[self setText: [NSString stringWithFormat: @"%@-- %@%@", nl, nl, signature]];
}
attachment = [NSDictionary dictionaryWithObjectsAndKeys:
[sourceMail filenameForForward], @"filename",
@"message/rfc822", @"mimetype",

View File

@@ -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 <wsourdeau@inverse.ca>
*
@@ -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 ? @"<br/>" : @"\n");
mailSignature = [NSString stringWithFormat: @"-- %@%@", nl, signature];
}
else
mailSignature = @"";