зеркало из https://github.com/mozilla/pjs.git
Port Bug #234186 --> Messages with mail server identity should not be sent through newsserver
to thunderbird Patch by Christian Eyrich
This commit is contained in:
Родитель
d01aeee430
Коммит
efbba7da66
|
@ -59,6 +59,8 @@ pref("editor.singleLine.pasteNewlines", 4); // substitute commas for new lines
|
|||
// to avoid the height of the header area from changing when headers are present / not present
|
||||
pref("mailnews.headers.minNumHeaders", 0); // 0 means we ignore this pref
|
||||
|
||||
pref("mail.compose.dontWarnMail2Newsgroup", false);
|
||||
|
||||
pref("messenger.throbber.url","chrome://messenger-region/locale/region.properties");
|
||||
pref("mailnews.release_notes.url","chrome://messenger-region/locale/region.properties");
|
||||
pref("mailnews.hints_and_tips.url","chrome://messenger-region/locale/region.properties");
|
||||
|
|
|
@ -1637,7 +1637,8 @@ function GenericSendMessage( msgType )
|
|||
if (msgType == nsIMsgCompDeliverMode.Now || msgType == nsIMsgCompDeliverMode.Later)
|
||||
{
|
||||
//Do we need to check the spelling?
|
||||
if (sPrefs.getBoolPref("mail.SpellCheckBeforeSend")){
|
||||
if (sPrefs.getBoolPref("mail.SpellCheckBeforeSend"))
|
||||
{
|
||||
//We disable spellcheck for the following -subject line, attachment pane, identity and addressing widget
|
||||
//therefore we need to explicitly focus on the mail body when we have to do a spellcheck.
|
||||
window.content.focus();
|
||||
|
@ -1663,8 +1664,7 @@ function GenericSendMessage( msgType )
|
|||
sComposeMsgsBundle.getString("subjectDlogMessage"),
|
||||
result,
|
||||
null,
|
||||
{value:0}
|
||||
))
|
||||
{value:0}))
|
||||
{
|
||||
msgCompFields.subject = result.value;
|
||||
var subjectInputElem = document.getElementById("msgSubject");
|
||||
|
@ -1675,6 +1675,36 @@ function GenericSendMessage( msgType )
|
|||
}
|
||||
}
|
||||
|
||||
// check if the user tries to send a message to a newsgroup through a mail account
|
||||
var currentAccountKey = getCurrentAccountKey();
|
||||
var account = gAccountManager.getAccount(currentAccountKey);
|
||||
var servertype = account.incomingServer.type;
|
||||
|
||||
if (servertype != "nntp" && msgCompFields.newsgroups != "")
|
||||
{
|
||||
// default to ask user if the pref is not set
|
||||
var dontAskAgain = sPrefs.getBoolPref("mail.compose.dontWarnMail2Newsgroup");
|
||||
|
||||
if (!dontAskAgain)
|
||||
{
|
||||
var checkbox = {value:false};
|
||||
var okToProceed = gPromptService.confirmCheck(window,
|
||||
sComposeMsgsBundle.getString("subjectDlogTitle"),
|
||||
sComposeMsgsBundle.getString("recipientDlogMessage"),
|
||||
sComposeMsgsBundle.getString("CheckMsg"), checkbox);
|
||||
|
||||
if (!okToProceed)
|
||||
return;
|
||||
|
||||
if (checkbox.value)
|
||||
sPrefs.setBoolPref(kDontAskAgainPref, true);
|
||||
}
|
||||
|
||||
// remove newsgroups to prevent news_p to be set
|
||||
// in nsMsgComposeAndSend::DeliverMessage()
|
||||
msgCompFields.newsgroups = "";
|
||||
}
|
||||
|
||||
// Before sending the message, check what to do with HTML message, eventually abort.
|
||||
var convert = DetermineConvertibility();
|
||||
var action = DetermineHTMLAction(convert);
|
||||
|
@ -1755,8 +1785,7 @@ function GenericSendMessage( msgType )
|
|||
gSendOrSaveOperationInProgress = true;
|
||||
}
|
||||
msgWindow.SetDOMWindow(window);
|
||||
|
||||
gMsgCompose.SendMsg(msgType, getCurrentIdentity(), getCurrentAccountKey(), msgWindow, progress);
|
||||
gMsgCompose.SendMsg(msgType, getCurrentIdentity(), currentAccountKey, msgWindow, progress);
|
||||
}
|
||||
catch (ex) {
|
||||
dump("failed to SendMsg: " + ex + "\n");
|
||||
|
|
Загрузка…
Ссылка в новой задаче