Commit 5744003a authored by Patrick Brunschwig's avatar Patrick Brunschwig

- check if account is enabled for Enigmail

- improve handling for S/MIME
parent 556c5437
......@@ -176,6 +176,7 @@ var EnigmailCommon = {
ENIG_FINAL_YES: 1,
ENIG_FINAL_FORCENO: 10,
ENIG_FINAL_FORCEYES: 11,
ENIG_FINAL_SMIME_DISABLED: 98, // disabled to to preferring S/MIME
ENIG_FINAL_CONFLICT: 99,
// variables
......
......@@ -139,11 +139,12 @@ Enigmail.msg = {
var msgId = document.getElementById("msgIdentityPopup");
if (msgId) {
msgId.setAttribute("oncommand", "Enigmail.msg.setIdentityCallback();");
msgId.addEventListener("command", Enigmail.msg.setIdentityCallback);
}
var subj = document.getElementById("msgSubject");
subj.setAttribute('onfocus', "Enigmail.msg.fireSendFlags()");
subj.addEventListener('focus', Enigmail.msg.fireSendFlags);
//subj.setAttribute('onfocus', "Enigmail.msg.fireSendFlags()");
// listen to S/MIME changes to potentially display "conflict" message
let s = document.getElementById("menu_securitySign1");
......@@ -190,7 +191,11 @@ Enigmail.msg = {
setIdentityCallback: function (elementId)
{
EnigmailCommon.DEBUG_LOG("enigmailMsgComposeOverlay.js: Enigmail.msg.setIdentityCallback: elementId="+elementId+"\n");
this.setIdentityDefaults();
EnigmailCommon.setTimeout(function _f() {
Enigmail.msg.setIdentityDefaults();
}
, 50);
},
......@@ -1374,6 +1379,20 @@ Enigmail.msg = {
}
}
if (gMsgCompose.compFields.securityInfo instanceof Components.interfaces.nsIMsgSMIMECompFields &&
(gMsgCompose.compFields.securityInfo.signMessage ||
gMsgCompose.compFields.securityInfo.requireEncryptMessage)) {
if (EnigmailCommon.getPref("mimePreferPgp") == 2) {
encFinally = EnigmailCommon.ENIG_FINAL_SMIME_DISABLED;
encReason = EnigmailCommon.getString("reasonSmimeConflict");
signFinally = EnigmailCommon.ENIG_FINAL_SMIME_DISABLED;
signReason = EnigmailCommon.getString("reasonSmimeConflict");
}
}
// process resulting PGP/MIME mode
if (this.pgpmimeForced == EnigmailCommon.ENIG_NEVER) { // force not to PGP/Mime?
pgpmimeFinally = EnigmailCommon.ENIG_FINAL_FORCENO;
......@@ -1823,6 +1842,12 @@ Enigmail.msg = {
displaySecuritySettings: function ()
{
EnigmailCommon.DEBUG_LOG("enigmailMsgComposeOverlay.js: Enigmail.msg.displaySecuritySettings\n");
if (this.statusEncrypted == EnigmailCommon.ENIG_FINAL_SMIME_DISABLED) {
EnigmailCommon.alert(window, "Enigmail is not used because S/MIME is currently enabled. Please turn off S/MIME signing and/or encryption and then enable Enigmail encryption");
return;
}
var inputObj = {
statusEncrypted: this.statusEncrypted,
statusSigned: this.statusSigned,
......
......@@ -235,7 +235,7 @@
id="enigmail-toolbar-header-button"
label="&enigmail.composetoolbar.header;"
buttontype="thunderbird"
oncommand="Enigmail.msg.displaySecuritySettings()">
oncommand="Enigmail.msg.doPgpButton('displaySecuritySettings')">
<label id="enigmail-toolbar-hdr-text" value="&enigmail.label;:"/>
</toolbarbutton>
......@@ -243,7 +243,7 @@
id="enigmail-toolbar-text-button"
label="&enigmail.composetoolbar.desc;"
buttontype="thunderbird"
oncommand="Enigmail.msg.displaySecuritySettings()">
oncommand="Enigmail.msg.doPgpButton('displaySecuritySettings')">
<label id="enigmail-toolbar-text" value="&enigmail.composetoolbar.desc;"/>
</toolbarbutton>
......
......@@ -202,6 +202,7 @@ reasonByRecipientRules=forced by recipient rules
reasonByAutoEncryption=forced by auto encryption
reasonByConflict=due to conflict in recipient rules
reasonByEncryptionMode=due to encryption mode
reasonSmimeConflict=because S/MIME is enabled instead
# should not be used anymore:
encryptConflict=Conflict when processing whether to encrypt the message
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment