зеркало из https://github.com/mozilla/gecko-dev.git
Bug #39736 --> set the charset on the compose field if we have one from the
top most message window. r=nhotta
This commit is contained in:
Родитель
072584458d
Коммит
8b3042c586
|
@ -66,6 +66,8 @@
|
||||||
#include "nsIDocShellTreeOwner.h"
|
#include "nsIDocShellTreeOwner.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsIIOService.h"
|
#include "nsIIOService.h"
|
||||||
|
#include "nsIMsgMailSession.h"
|
||||||
|
#include "nsMsgBaseCID.h"
|
||||||
|
|
||||||
// Defines....
|
// Defines....
|
||||||
static NS_DEFINE_CID(kMsgQuoteCID, NS_MSGQUOTE_CID);
|
static NS_DEFINE_CID(kMsgQuoteCID, NS_MSGQUOTE_CID);
|
||||||
|
@ -1028,6 +1030,23 @@ nsresult nsMsgCompose::CreateMessage(const PRUnichar * originalMsgURI,
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
prefs->GetBoolPref("mail.auto_quote", &mQuotingToFollow);
|
prefs->GetBoolPref("mail.auto_quote", &mQuotingToFollow);
|
||||||
|
|
||||||
|
// HACK: if we are replying to a message and that message used a charset over ride
|
||||||
|
// (as speciifed in the top most window (assuming the reply originated from that window)
|
||||||
|
// then use that over ride charset instead of the charset specified in the message
|
||||||
|
nsCOMPtr <nsIMsgMailSession> mailSession = do_GetService(NS_MSGMAILSESSION_PROGID);
|
||||||
|
if (mailSession)
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIMsgWindow> msgWindow;
|
||||||
|
mailSession->GetTopmostMsgWindow(getter_AddRefs(msgWindow));
|
||||||
|
if (msgWindow)
|
||||||
|
{
|
||||||
|
nsXPIDLString mailCharset;
|
||||||
|
msgWindow->GetMailCharacterSet(getter_Copies(mailCharset));
|
||||||
|
if (mailCharset && (* (const PRUnichar *) mailCharset) )
|
||||||
|
aCharset = mailCharset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// get an original charset, used for a label, UTF-8 is used for the internal processing
|
// get an original charset, used for a label, UTF-8 is used for the internal processing
|
||||||
if (!aCharset.IsEmpty())
|
if (!aCharset.IsEmpty())
|
||||||
{
|
{
|
||||||
|
@ -1073,9 +1092,9 @@ nsresult nsMsgCompose::CreateMessage(const PRUnichar * originalMsgURI,
|
||||||
recipStr.AppendWithConversion(", ");
|
recipStr.AppendWithConversion(", ");
|
||||||
recipStr += ccListStr;
|
recipStr += ccListStr;
|
||||||
{
|
{
|
||||||
nsCAutoString recipStrCStr; recipStrCStr.AssignWithConversion(recipStr);
|
nsCAutoString recipStrCStr; recipStrCStr.AssignWithConversion(recipStr);
|
||||||
m_compFields->SetCc(recipStrCStr);
|
m_compFields->SetCc(recipStrCStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NS_SUCCEEDED(rv = nsMsgI18NDecodeMimePartIIStr(recipStr, encodedCharset, decodedString)))
|
if (NS_SUCCEEDED(rv = nsMsgI18NDecodeMimePartIIStr(recipStr, encodedCharset, decodedString)))
|
||||||
if (NS_SUCCEEDED(rv = ConvertFromUnicode(NS_ConvertASCIItoUCS2(msgCompHeaderInternalCharset()), decodedString, &aCString)))
|
if (NS_SUCCEEDED(rv = ConvertFromUnicode(NS_ConvertASCIItoUCS2(msgCompHeaderInternalCharset()), decodedString, &aCString)))
|
||||||
|
@ -1564,7 +1583,10 @@ nsMsgCompose::QuoteOriginalMessage(const PRUnichar *originalMsgURI, PRInt32 what
|
||||||
NS_ADDREF(this);
|
NS_ADDREF(this);
|
||||||
mQuoteStreamListener->SetComposeObj(this);
|
mQuoteStreamListener->SetComposeObj(this);
|
||||||
|
|
||||||
rv = mQuote->QuoteMessage(originalMsgURI, what != 1, mQuoteStreamListener);
|
nsXPIDLString msgCharSet;
|
||||||
|
m_compFields->GetCharacterSet(getter_Copies(msgCharSet));
|
||||||
|
|
||||||
|
rv = mQuote->QuoteMessage(originalMsgURI, what != 1, mQuoteStreamListener, msgCharSet);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче