Added a field to nsMsgAttachmentHandler in order to avoid applying base64 for main body, bug 33987, r=rhp.

This commit is contained in:
nhotta%netscape.com 2000-05-05 20:35:57 +00:00
Родитель bd167d1990
Коммит a873dde79f
3 изменённых файлов: 6 добавлений и 2 удалений

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

@ -77,6 +77,7 @@ nsMsgAttachmentHandler::nsMsgAttachmentHandler()
{
mMHTMLPart = PR_FALSE;
mPartUserOmissionOverride = PR_FALSE;
mMainBody = PR_FALSE;
m_charset = NULL;
m_override_type = NULL;
@ -222,7 +223,7 @@ nsMsgAttachmentHandler::PickEncoding(const char *charset)
if (NS_SUCCEEDED(rv) && prefs)
prefs->GetBoolPref ("mail.file_attach_binary", &forceB64);
if (forceB64 || mime_type_requires_b64_p (m_type))
if (!mMainBody && (forceB64 || mime_type_requires_b64_p (m_type)))
{
/* If the content-type is "image/" or something else known to be binary,
always use base64 (so that we don't get confused by newline
@ -281,7 +282,7 @@ nsMsgAttachmentHandler::PickEncoding(const char *charset)
(PL_strcasecmp(m_type, MESSAGE_NEWS) == 0)))
{
PR_FREEIF(m_encoding);
m_encoding = PL_strdup (ENCODING_7BIT);
m_encoding = PL_strdup (mMainBody ? ENCODING_7BIT : ENCODING_8BIT);
}
else if (encode_p &&
m_size > 500 &&

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

@ -124,6 +124,7 @@ public:
PRBool mMHTMLPart; // This is true if its an MHTML part, otherwise, PR_FALSE
PRBool mPartUserOmissionOverride; // This is true if the user send send the email without this part
PRBool mMainBody; // True if this is a main body.
//
// Vars for analyzing file data...

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

@ -695,6 +695,8 @@ nsMsgComposeAndSend::GatherMimeAttachments()
if (status < 0)
goto FAIL;
m_plaintext->mMainBody = PR_TRUE;
m_plaintext->AnalyzeSnarfedFile(); // look for 8 bit text, long lines, etc.
m_plaintext->PickEncoding(mCompFields->GetCharacterSet());
hdrs = mime_generate_attachment_headers(m_plaintext->m_type,