From c43de3492aec44b7b154083c8e50582c0ab4c4e7 Mon Sep 17 00:00:00 2001 From: "ducarroz%netscape.com" Date: Tue, 1 Feb 2000 01:59:46 +0000 Subject: [PATCH] Fix bug 25610. We need to wrap the body into a
 tag when
 forwarding inline a plain text message in HTML compose mode. R=rhp

---
 mailnews/mime/src/mimedrft.cpp | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/mailnews/mime/src/mimedrft.cpp b/mailnews/mime/src/mimedrft.cpp
index 200d285fdc7..dfb4654287d 100644
--- a/mailnews/mime/src/mimedrft.cpp
+++ b/mailnews/mime/src/mimedrft.cpp
@@ -221,7 +221,7 @@ mime_dump_attachments ( attachmentList );
   if ((NS_FAILED(rv)) || (!msgComposeService))
     return rv; 
   
-  if (identity)
+  if (identity && composeType == nsIMsgCompType::ForwardInline)
   {
   	PRBool composeHtml = PR_FALSE;
   	identity->GetComposeHtml(&composeHtml);
@@ -1280,11 +1280,31 @@ mime_parse_stream_complete (nsMIMESession *stream)
   
         // Since we have body text, then we should set the compose fields with
         // this data.      
-        if (composeFormat == nsIMsgCompFormat::PlainText)
-          fields->SetTheForcePlainText(PR_TRUE);
+ //       if (composeFormat == nsIMsgCompFormat::PlainText)
+ //         fields->SetTheForcePlainText(PR_TRUE);
         
         if (forward_inline)
         {
+		  if (mdd->identity)
+		  {
+			 PRBool bFormat;
+			 mdd->identity->GetComposeHtml(&bFormat);
+			 if (bFormat)
+			 {
+			   if (body && composeFormat == nsIMsgCompFormat::PlainText)
+			   {
+				char* newbody = (char *)PR_MALLOC (bodyLen + 12); //+11 chars for 
 & 
tags + *newbody = 0; + PL_strcat(newbody, "
");
+				PL_strcat(newbody, body);
+				PL_strcat(newbody, "
"); + PR_Free(body); + body = newbody; + composeFormat = nsIMsgCompFormat::HTML; + } + } + } + mime_insert_forwarded_message_headers(&body, mdd->headers, composeFormat, mdd->mailcharset); }