[X2Go-Commits] [pale-moon] 94/294: Remove fxAccountsEnabled checks.

git-admin at x2go.org git-admin at x2go.org
Sat Apr 27 08:57:54 CEST 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch upstream/28.5.0
in repository pale-moon.

commit f999f544aad04069b03704d994a99352263f600b
Author: wolfbeast <mcwerewolf at wolfbeast.com>
Date:   Wed Mar 13 16:36:55 2019 +0100

    Remove fxAccountsEnabled checks.
    
    Tag #812
---
 .../basilisk/base/content/browser-syncui.js        | 24 ++--------------
 application/basilisk/base/content/sync/utils.js    | 13 ++-------
 .../components/preferences/in-content/sync.js      | 32 ++++++----------------
 3 files changed, 13 insertions(+), 56 deletions(-)

diff --git a/application/basilisk/base/content/browser-syncui.js b/application/basilisk/base/content/browser-syncui.js
index 000c8f7..b796e66 100644
--- a/application/basilisk/base/content/browser-syncui.js
+++ b/application/basilisk/base/content/browser-syncui.js
@@ -93,14 +93,6 @@ var gSyncUI = {
   // Returns a promise that resolves with true if Sync needs to be configured,
   // false otherwise.
   _needsSetup() {
-    // If Sync is configured for FxAccounts then we do that promise-dance.
-    if (this.weaveService.fxAccountsEnabled) {
-      return fxAccounts.getSignedInUser().then(user => {
-        // We want to treat "account needs verification" as "needs setup".
-        return !(user && user.verified);
-      });
-    }
-    // We are using legacy sync - check that.
     let firstSync = "";
     try {
       firstSync = Services.prefs.getCharPref("services.sync.firstSync");
@@ -114,19 +106,9 @@ var gSyncUI = {
   // to Sync needs to be verified, false otherwise.
   _needsVerification() {
     // For callers who care about the distinction between "needs setup" and
-    // "needs verification"
-    if (this.weaveService.fxAccountsEnabled) {
-      return fxAccounts.getSignedInUser().then(user => {
-        // If there is no user, they can't be in a "needs verification" state.
-        if (!user) {
-          return false;
-        }
-        return !user.verified;
-      });
-    }
-
-    // Otherwise we are configured for legacy Sync, which has no verification
-    // concept.
+    // "needs verification". Only for fxAccounts. XXX: remove this check.
+    // Since we are configured for legacy Sync only, which has no verification
+    // concept, just return false.
     return Promise.resolve(false);
   },
 
diff --git a/application/basilisk/base/content/sync/utils.js b/application/basilisk/base/content/sync/utils.js
index 92981f7..1422c1d 100644
--- a/application/basilisk/base/content/sync/utils.js
+++ b/application/basilisk/base/content/sync/utils.js
@@ -14,13 +14,6 @@ var gSyncUtils = {
     return this.bundle = Services.strings.createBundle("chrome://browser/locale/syncSetup.properties");
   },
 
-  get fxAccountsEnabled() {
-    let service = Components.classes["@mozilla.org/weave/service;1"]
-                            .getService(Components.interfaces.nsISupports)
-                            .wrappedJSObject;
-    return service.fxAccountsEnabled;
-  },
-
   // opens in a new window if we're in a modal prefwindow world, in a new tab otherwise
   _openLink: function (url) {
     let thisDocEl = document.documentElement,
@@ -78,8 +71,7 @@ var gSyncUtils = {
   },
 
   get tosURL() {
-    let root = this.fxAccountsEnabled ? "fxa." : "";
-    return  Weave.Svc.Prefs.get(root + "termsURL");
+    return  Weave.Svc.Prefs.get("termsURL");
   },
 
   openToS: function () {
@@ -87,8 +79,7 @@ var gSyncUtils = {
   },
 
   get privacyPolicyURL() {
-    let root = this.fxAccountsEnabled ? "fxa." : "";
-    return  Weave.Svc.Prefs.get(root + "privacyURL");
+    return  Weave.Svc.Prefs.get("privacyURL");
   },
 
   openPrivacyPolicy: function () {
diff --git a/application/basilisk/components/preferences/in-content/sync.js b/application/basilisk/components/preferences/in-content/sync.js
index 2600677..32b94de 100644
--- a/application/basilisk/components/preferences/in-content/sync.js
+++ b/application/basilisk/components/preferences/in-content/sync.js
@@ -92,19 +92,7 @@ var gSyncPane = {
     } catch (e) {}
     if (!username) {
       this.page = FXA_PAGE_LOGGED_OUT;
-    } else if (xps.fxAccountsEnabled) {
-      // Use cached values while we wait for the up-to-date values
-      let cachedComputerName;
-      try {
-        cachedComputerName = Services.prefs.getCharPref("services.sync.client.name");
-      }
-      catch (e) {
-        cachedComputerName = "";
-      }
-      document.getElementById("fxaEmailAddress1").textContent = username;
-      this._populateComputerName(cachedComputerName);
-      this.page = FXA_PAGE_LOGGED_IN;
-    } else { // Old Sync
+    } else {
       this.page = PAGE_HAS_ACCOUNT;
     }
   },
@@ -388,17 +376,13 @@ var gSyncPane = {
                   .getService(Components.interfaces.nsISupports)
                   .wrappedJSObject;
 
-    if (service.fxAccountsEnabled) {
-      this._openAboutAccounts();
-    } else {
-      let win = Services.wm.getMostRecentWindow("Weave:AccountSetup");
-      if (win)
-        win.focus();
-      else {
-        window.openDialog("chrome://browser/content/sync/setup.xul",
-                          "weaveSetup", "centerscreen,chrome,resizable=no",
-                          wizardType);
-      }
+    let win = Services.wm.getMostRecentWindow("Weave:AccountSetup");
+    if (win)
+      win.focus();
+    else {
+      window.openDialog("chrome://browser/content/sync/setup.xul",
+                        "weaveSetup", "centerscreen,chrome,resizable=no",
+                        wizardType);
     }
   },
 

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pale-moon.git


More information about the x2go-commits mailing list