зеркало из https://github.com/mozilla/pjs.git
Contribution by Daniel Bratell <bratell@lysator.liu.se> to implement
format=flowed for mail plaintext output. r=akkana and (I think) rhp.
This commit is contained in:
Родитель
699b06e0b8
Коммит
385c40ae49
|
@ -792,6 +792,23 @@ mime_generate_attachment_headers (const char *type, const char *encoding,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Add format=flowed as in RFC 2646 unless asked to not do that.
|
||||||
|
PRBool sendFlowed = PR_TRUE; /* rhp - add this */
|
||||||
|
if(type && !PL_strcasecmp(type, "text/plain") && prefs)
|
||||||
|
{
|
||||||
|
prefs->GetBoolPref("mail.send_plaintext_flowed", &sendFlowed);
|
||||||
|
if (sendFlowed)
|
||||||
|
PUSH_STRING ("; format=flowed");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// This is the same as no format at all.
|
||||||
|
PUSH_STRING ("; format=fixed");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (x_mac_type && *x_mac_type) {
|
if (x_mac_type && *x_mac_type) {
|
||||||
PUSH_STRING ("; x-mac-type=\"");
|
PUSH_STRING ("; x-mac-type=\"");
|
||||||
PUSH_STRING (x_mac_type);
|
PUSH_STRING (x_mac_type);
|
||||||
|
|
|
@ -415,7 +415,17 @@ nsresult nsMsgCompose::SendMsg(MSG_DeliverMode deliverMode,
|
||||||
PRUnichar *bodyText = NULL;
|
PRUnichar *bodyText = NULL;
|
||||||
nsString format(contentType);
|
nsString format(contentType);
|
||||||
PRUint32 flags = nsIDocumentEncoder::OutputFormatted;
|
PRUint32 flags = nsIDocumentEncoder::OutputFormatted;
|
||||||
|
|
||||||
|
nsresult rv2;
|
||||||
|
NS_WITH_SERVICE(nsIPref, prefs, kPrefCID, &rv2);
|
||||||
|
if (NS_SUCCEEDED(rv2)) {
|
||||||
|
PRBool sendflowed;
|
||||||
|
rv2=prefs->GetBoolPref("mailnews.send_plaintext_flowed", &sendflowed);
|
||||||
|
if(!(NS_SUCCEEDED(rv2) && !sendflowed))
|
||||||
|
// Unless explicitly forbidden...
|
||||||
|
flags |= nsIDocumentEncoder::OutputFormatFlowed;
|
||||||
|
}
|
||||||
|
|
||||||
rv = m_editor->GetContentsAs(format.GetUnicode(), flags, &bodyText);
|
rv = m_editor->GetContentsAs(format.GetUnicode(), flags, &bodyText);
|
||||||
|
|
||||||
if (NS_SUCCEEDED(rv) && NULL != bodyText)
|
if (NS_SUCCEEDED(rv) && NULL != bodyText)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче