Bug 1654950 - If a signed OpenPGP message automatically includes the public key should be configurable. r=PatrickBrunschwig a=wsmwk
authorKai Engert <kaie@kuix.de>
Mon, 02 Nov 2020 10:51:48 +0100
changeset 40033 0760c5edac573b68e94030f2a8f80394c50e9f17
parent 40032 b379b74ed3c17d8488a8573f933259b76f33dcc1
child 40034 d946f1c609c5deec01b82cebd11a551b38eb48c9
push id106
push userkaie@kuix.de
push dateFri, 13 Nov 2020 10:41:12 +0000
treeherdercomm-esr78@eec8c8a0d2e3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersPatrickBrunschwig, wsmwk
bugs1654950
Bug 1654950 - If a signed OpenPGP message automatically includes the public key should be configurable. r=PatrickBrunschwig a=wsmwk Differential Revision: https://phabricator.services.mozilla.com/D95637
mail/components/compose/content/MsgComposeCommands.js
mail/extensions/am-e2e/prefs/e2e-prefs.js
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -1686,17 +1686,17 @@ function isPgpConfigured() {
 }
 
 function toggleGlobalSignMessage() {
   gSendSigned = !gSendSigned;
   gUserTouchedSendSigned = true;
 
   if (!gUserTouchedAttachMyPubKey) {
     if (gSendSigned) {
-      gAttachMyPublicPGPKey = true;
+      gAttachMyPublicPGPKey = gCurrentIdentity.getBoolAttribute("attachPgpKey");
     } else {
       gAttachMyPublicPGPKey = gAttachMyPublicPGPKeyInitial;
     }
   }
 
   setEncSigStatusUI();
 }
 
@@ -1734,17 +1734,17 @@ function setGlobalEncryptMessage(mode) {
       gSendSigned = true;
     } else {
       gSendSigned = gSendSignedInitial;
     }
   }
 
   if (!gUserTouchedAttachMyPubKey) {
     if (gSendSigned) {
-      gAttachMyPublicPGPKey = true;
+      gAttachMyPublicPGPKey = gCurrentIdentity.getBoolAttribute("attachPgpKey");
     } else {
       gAttachMyPublicPGPKey = gAttachMyPublicPGPKeyInitial;
     }
   }
 
   setEncSigStatusUI();
 }
 
@@ -3818,17 +3818,17 @@ function adjustSignEncryptAfterIdentityC
     }
 
     gSendEncryptedInitial = gSendEncrypted;
     gSendSignedInitial = gSendSigned;
     gAttachMyPublicPGPKeyInitial = gAttachMyPublicPGPKey;
 
     // automatic changes after this line
     if (gSendSigned && gSelectedTechnologyIsPGP) {
-      gAttachMyPublicPGPKey = true;
+      gAttachMyPublicPGPKey = gCurrentIdentity.getBoolAttribute("attachPgpKey");
     }
   } else {
     // When switching the Sender identity, use the more secure setting
     // for encryption and signing, respectively.
 
     // For encryption, the more secure setting is "enabled".
 
     // If the user has had encryption enabled for a message initially,
--- a/mail/extensions/am-e2e/prefs/e2e-prefs.js
+++ b/mail/extensions/am-e2e/prefs/e2e-prefs.js
@@ -235,17 +235,17 @@ pref("temp.openpgp.enableExperiments", f
    Default pref values for the enigmail per-identity
    settings
 */
 
 pref("mail.identity.default.defaultSigningPolicy", 0);
 pref("mail.identity.default.defaultEncryptionPolicy", 0);
 pref("mail.identity.default.openPgpUrlName", "");
 pref("mail.identity.default.pgpMimeMode", true);
-pref("mail.identity.default.attachPgpKey", false);
+pref("mail.identity.default.attachPgpKey", true);
 pref("mail.identity.default.protectSubject", true);
 pref("mail.identity.default.warnWeakReply", false);
 
 // prefer S/MIME or PGP/MIME (0: S/MIME, 1: PGP/MIME)
 pref("mail.identity.default.mimePreferOpenPGP", 1);
 
 /*
    Other settings (change Mozilla behaviour)