From 11792134c4743f93a7ed2f2c351703f327fded9e Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" Date: Tue, 14 Aug 2001 13:33:59 +0000 Subject: [PATCH] Do not add "-- \n" to signature if it's already in the sig file. Bug 30208. r=bratell, sr=sspitzer. --- mailnews/compose/src/nsMsgCompose.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/mailnews/compose/src/nsMsgCompose.cpp b/mailnews/compose/src/nsMsgCompose.cpp index 1f9a342e74cd..06d9cf677672 100644 --- a/mailnews/compose/src/nsMsgCompose.cpp +++ b/mailnews/compose/src/nsMsgCompose.cpp @@ -2525,7 +2525,6 @@ nsMsgCompose::ProcessSignature(nsIMsgIdentity *identity, nsString *aMsgBody) // are doing plain text compose, we should insert some sort of message // saying "Image Signature Omitted" or something. // - nsAutoString urlStr; nsXPIDLCString sigNativePath; PRBool useSigFile = PR_FALSE; PRBool htmlSig = PR_FALSE; @@ -2646,16 +2645,21 @@ nsMsgCompose::ProcessSignature(nsIMsgIdentity *identity, nsString *aMsgBody) else sigOutput.AppendWithConversion(CRLF); - sigOutput.AppendWithConversion(dashes); - - if ( (!m_composeHTML) || ((m_composeHTML) && (!htmlSig)) ) - sigOutput.AppendWithConversion(CRLF); - else if (m_composeHTML) - sigOutput.AppendWithConversion(htmlBreak); + nsAString& firstFourChars = Substring(sigData, 0, 4); + + if (!(firstFourChars.Equals(NS_LITERAL_STRING("-- \n")) || + firstFourChars.Equals(NS_LITERAL_STRING("-- \r"))) + { + sigOutput.AppendWithConversion(dashes); + + if (!m_composeHTML || !htmlSig) + sigOutput.AppendWithConversion(CRLF); + else if (m_composeHTML) + sigOutput.AppendWithConversion(htmlBreak); + } sigOutput.Append(sigData); - //DELETEME: I18N: Converting down (2byte->1byte) OK? - + if (m_composeHTML) { if (htmlSig)