[tor-commits] [torbirdy/master] Refactor.

sukhbir at torproject.org sukhbir at torproject.org
Wed May 4 17:25:02 UTC 2016


commit 7fc8da14e00d2e6d2436358ffd509e81527bdfa6
Author: anonym <anonym at riseup.net>
Date:   Fri Mar 18 16:51:09 2016 +0100

    Refactor.
---
 chrome/content/preferences.js | 40 ++++++++++++----------------------------
 1 file changed, 12 insertions(+), 28 deletions(-)

diff --git a/chrome/content/preferences.js b/chrome/content/preferences.js
index 1359f63..de77205 100644
--- a/chrome/content/preferences.js
+++ b/chrome/content/preferences.js
@@ -37,36 +37,20 @@ if (!org.torbirdy.prefs) org.torbirdy.prefs = new function() {
   };
 
   pub.setEnigmailPrefs = function(anonService) {
+    var opts = "";
     if (pub.prefs.getBoolPref("extensions.torbirdy.enigmail.throwkeyid")) {
-      if (anonService === "tor") {
-        return "--no-emit-version " +
-               "--no-comments " +
-               "--throw-keyids " +
-               "--display-charset utf-8 " +
-               "--keyserver-options no-auto-key-retrieve,no-try-dns-srv,http-proxy=http://127.0.0.1:8118";
-      }
-      if (anonService === "jondo") {
-        return "--no-emit-version " +
-               "--no-comments " +
-               "--throw-keyids " +
-               "--display-charset utf-8 " +
-               "--keyserver-options no-auto-key-retrieve,no-try-dns-srv,http-proxy=http://127.0.0.1:4001";
-      }
-    }
-    else {
-      if (anonService === "tor") {
-        return "--no-emit-version " +
-               "--no-comments " +
-               "--display-charset utf-8 " +
-               "--keyserver-options no-auto-key-retrieve,no-try-dns-srv,http-proxy=http://127.0.0.1:8118";
-      }
-      if (anonService === "jondo") {
-        return "--no-emit-version " +
-               "--no-comments " +
-               "--display-charset utf-8 " +
-               "--keyserver-options no-auto-key-retrieve,no-try-dns-srv,http-proxy=http://127.0.0.1:4001";
-      }
+      opts += "--throw-keyids ";
     }
+    var proxy = "http-proxy=http://127.0.0.1:8118";
+    if (anonService === "jondo") {
+      proxy = "http://127.0.0.1:4001";
+    }
+    return opts +
+           "--no-emit-version " +
+           "--no-comments " +
+           "--display-charset utf-8 " +
+           "--keyserver-options no-auto-key-retrieve,no-try-dns-srv,http-proxy=" +
+           proxy;
   };
 
   pub.updateKeyserver = function(anonService) {





More information about the tor-commits mailing list