[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [torbirdy/master] Update preferences.js for disabling encrypted mail headers



commit cd78562e931ede3b64fcfa6f16af78f34ed7f9ff
Author: Sukhbir Singh <sukhbir@xxxxxxxxxxxxxx>
Date:   Fri Aug 4 10:10:16 2017 -0400

    Update preferences.js for disabling encrypted mail headers
---
 chrome/content/preferences.js | 14 +++++++++-----
 defaults/preferences/prefs.js |  1 -
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/chrome/content/preferences.js b/chrome/content/preferences.js
index 3906c67..8acd6ba 100644
--- a/chrome/content/preferences.js
+++ b/chrome/content/preferences.js
@@ -375,11 +375,9 @@ if (!org.torbirdy.prefs) org.torbirdy.prefs = new function() {
     // Protected email headers - default: true
     var enigmailProtectedPref = "extensions.enigmail.protectHeaders";
     if (pub.enigmailProtected.checked) {
-      pub.prefs.setBoolPref(enigmailProtectedPref, false);
-      pub.prefs.setBoolPref(pub.prefBranch + 'enigmail.protected', false);
+      pub.setPreferences(enigmailProtectedPref, false);
     } else {
-      pub.prefs.setBoolPref(enigmailProtectedPref, true);
-      pub.prefs.setBoolPref(pub.prefBranch + 'enigmail.protected', true);
+      pub.setPreferences(enigmailProtectedPref, true);
     }
   };
 
@@ -512,7 +510,13 @@ if (!org.torbirdy.prefs) org.torbirdy.prefs = new function() {
     }
 
     // Protected email headers - default: true
-    if (pub.prefs.getBoolPref(pub.prefBranch + 'enigmail.protected')) {
+    var protectedPref = pub.customBranch + 'extensions.enigmail.protectHeaders';
+    if (pub.prefs.prefHasUserValue(protectedPref)) {
+      var protectedPrefValue = pub.prefs.getBoolPref(protectedPref);
+    } else {
+      var protectedPrefValue = pub.prefs.getBoolPref('extensions.enigmail.protectHeaders');
+    }
+    if (protectedPrefValue) {
       pub.enigmailProtected.checked = false;
     } else {
       pub.enigmailProtected.checked = true;
diff --git a/defaults/preferences/prefs.js b/defaults/preferences/prefs.js
index 8958ca3..ea316d3 100644
--- a/defaults/preferences/prefs.js
+++ b/defaults/preferences/prefs.js
@@ -5,7 +5,6 @@ pref("extensions.torbirdy.warn", true);
 pref("extensions.torbirdy.startup_folder", false);
 pref("extensions.torbirdy.enigmail.throwkeyid", false);
 pref("extensions.torbirdy.enigmail.confirmemail", false);
-pref("extensions.torbirdy.enigmail.protected", true);
 pref("extensions.torbirdy.gpg_already_torified", false);
 pref("extensions.torbirdy.timezone", true);
 pref("extensions.torbirdy.whonix_run", true);

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits