fix 289003, make mapi send detect html msg bodies, sr=mscott

This commit is contained in:
bienvenu%nventure.com 2005-04-04 20:47:47 +00:00
Родитель 36eb2aa71d
Коммит be3b927e1a
1 изменённых файлов: 14 добавлений и 3 удалений

Просмотреть файл

@ -39,8 +39,6 @@
#define MAPI_STARTUP_ARG "/MAPIStartUp"
#define MAPI_STARTUP_ARG "/MAPIStartUp"
#ifdef MOZ_LOGGING
// this has to be before the pre-compiled header
#define FORCE_PR_LOG /* Allow logging in the release build */
@ -388,8 +386,10 @@ nsresult nsMapiHook::BlindSendMail (unsigned long aSession, nsIMsgCompFields * a
if (NS_FAILED(rv) || (!pMsgComposeParams) ) return rv ;
// populate the compose params
PRBool forcePlainText;
aCompFields->GetForcePlainText(&forcePlainText);
pMsgComposeParams->SetType(nsIMsgCompType::New);
pMsgComposeParams->SetFormat(nsIMsgCompFormat::Default);
pMsgComposeParams->SetFormat(forcePlainText ? nsIMsgCompFormat::PlainText : nsIMsgCompFormat::HTML);
pMsgComposeParams->SetIdentity(pMsgId);
pMsgComposeParams->SetComposeFields(aCompFields);
pMsgComposeParams->SetSendListener(sendListener) ;
@ -505,6 +505,10 @@ nsresult nsMapiHook::PopulateCompFields(lpnsMapiMessage aMessage,
Body.AssignWithConversion(aMessage->lpszNoteText);
if (Body.Last() != nsCRT::LF)
Body.AppendLiteral(CRLF);
if (Body.Find("<html>") == kNotFound)
aCompFields->SetForcePlainText(PR_TRUE);
rv = aCompFields->SetBody(Body) ;
}
@ -711,6 +715,10 @@ nsresult nsMapiHook::PopulateCompFieldsWithConversion(lpnsMapiMessage aMessage,
if (NS_FAILED(rv)) return rv ;
if (Body.Last() != nsCRT::LF)
Body.AppendLiteral(CRLF);
if (Body.Find("<html>") == kNotFound)
aCompFields->SetForcePlainText(PR_TRUE);
rv = aCompFields->SetBody(Body) ;
}
@ -872,6 +880,9 @@ nsresult nsMapiHook::ShowComposerWindow (unsigned long aSession, nsIMsgCompField
nsCOMPtr<nsIMsgComposeParams> pMsgComposeParams (do_CreateInstance(NS_MSGCOMPOSEPARAMS_CONTRACTID, &rv));
if (NS_FAILED(rv) || (!pMsgComposeParams) ) return rv ;
PRBool forcePlainText;
aCompFields->GetForcePlainText(&forcePlainText);
pMsgComposeParams->SetFormat(forcePlainText ? nsIMsgCompFormat::Default : nsIMsgCompFormat::HTML);
// populate the compose params
pMsgComposeParams->SetType(nsIMsgCompType::New);
pMsgComposeParams->SetFormat(nsIMsgCompFormat::Default);