зеркало из https://github.com/mozilla/gecko-dev.git
Bug 234186 Don't allow mail identites to post to newsgroups p=ch.ey@gmx.net r=me sr=mscott
This commit is contained in:
Родитель
255bacc1d4
Коммит
f0a4f9efc5
|
@ -1618,6 +1618,46 @@ 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 != "")
|
||||
{
|
||||
const kDontAskAgainPref = "mail.compose.dontWarnMail2Newsgroup";
|
||||
// default to ask user if the pref is not set
|
||||
var dontAskAgain = false;
|
||||
try {
|
||||
var pref = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
dontAskAgain = pref.getBoolPref(kDontAskAgainPref);
|
||||
} catch (ex) {}
|
||||
|
||||
if (!dontAskAgain)
|
||||
{
|
||||
var checkbox = {value:false};
|
||||
var okToProceed = gPromptService.confirmCheck(
|
||||
window,
|
||||
sComposeMsgsBundle.getString("subjectDlogTitle"),
|
||||
sComposeMsgsBundle.getString("recipientDlogMessage"),
|
||||
sComposeMsgsBundle.getString("CheckMsg"),
|
||||
checkbox);
|
||||
|
||||
if (!okToProceed)
|
||||
return;
|
||||
|
||||
try {
|
||||
if (checkbox.value)
|
||||
pref.setBoolPref(kDontAskAgainPref, true);
|
||||
} catch (ex) {}
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
@ -1692,7 +1732,7 @@ function GenericSendMessage( msgType )
|
|||
}
|
||||
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");
|
||||
|
|
|
@ -259,6 +259,9 @@ windowTitlePrefix=Compose:
|
|||
subjectDlogTitle=Send Message
|
||||
subjectDlogMessage=You did not specify a subject for this message. If you would like to provide one, please type it now.
|
||||
|
||||
## String used by the dialog that informs the user about the newsgroup recipient
|
||||
recipientDlogMessage=This account only supports email recipients. Continuing will ignore newsgroups.
|
||||
|
||||
## String used by the dialog that ask the user to attach a web page
|
||||
attachPageDlogTitle=Please specify a location to attach
|
||||
attachPageDlogMessage=Web Page (URL):
|
||||
|
|
Загрузка…
Ссылка в новой задаче