Bug 1433350 - remove uses of nsIUserInfo from Thunderbird. r=mkmelin
authoraceman <acelists@atlas.sk>
Fri, 05 Apr 2019 09:00:06 +0200
changeset 26244 92d3924994f3c0dbbb7e56f6aa87e510040336a7
parent 26243 76cba5d0233aded3bbb881c0e6440a0a9f2015ab
child 26245 cd7996fcf42b5ba9ea7db93a449d943ca2a0a55f
push id15749
push usermozilla@jorgk.com
push dateFri, 05 Apr 2019 07:05:02 +0000
treeherdercomm-central@92d3924994f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1433350
Bug 1433350 - remove uses of nsIUserInfo from Thunderbird. r=mkmelin
mail/components/accountcreation/content/emailWizard.js
mail/components/newmailaccount/content/accountProvisioner.js
mailnews/base/prefs/content/aw-identity.js
--- a/mail/components/accountcreation/content/emailWizard.js
+++ b/mail/components/accountcreation/content/emailWizard.js
@@ -160,28 +160,19 @@ EmailConfigWizard.prototype = {
      * adapt when the user enters a different realname, or password or
      * email local part. (A change of the domain name will trigger a new
      * detection anyways.)
      * That means, before you actually use the config (e.g. to create an
      * account or to show it to the user), you need to run replaceVariables().
      */
     this._currentConfig = null;
 
-    let userFullname;
-    try {
-      let userInfo = Cc["@mozilla.org/userinfo;1"].getService(Ci.nsIUserInfo);
-      userFullname = userInfo.fullname;
-    } catch (e) {
-      // nsIUserInfo may not be implemented on all platforms, and name might
-      // not be available even if it is.
-    }
-
     this._domain = "";
     this._email = "";
-    this._realname = (userFullname) ? userFullname : "";
+    this._realname = "";
     e("realname").value = this._realname;
     this._password = "";
     this._exchangeUsername = ""; // only for Exchange AutoDiscover and only if needed
     this._okCallback = null;
 
     if (window.arguments && window.arguments[0]) {
       if (window.arguments[0].msgWindow) {
         this._parentMsgWindow = window.arguments[0].msgWindow;
--- a/mail/components/newmailaccount/content/accountProvisioner.js
+++ b/mail/components/newmailaccount/content/accountProvisioner.js
@@ -279,28 +279,18 @@ var EmailAccountProvisioner = {
     // Link the keypress function to the name field so that we can enable and
     // disable the search button.
     let nameElement = document.getElementById("name");
     nameElement.addEventListener("keyup",
       EmailAccountProvisioner.onSearchInputOrProvidersChanged);
 
     // If we have a name stored in local storage from an earlier session,
     // populate the search field with it.
-    let name = EmailAccountProvisioner.storage.getItem("name") ||
-               nameElement.value;
-    if (!name) {
-      try {
-        let userInfo = Cc["@mozilla.org/userinfo;1"].getService(Ci.nsIUserInfo);
-        name = userInfo.fullname;
-      } catch (e) {
-        // nsIUserInfo may not be implemented on all platforms, and name might
-        // not be available even if it is.
-      }
-    }
-    nameElement.value = name;
+    nameElement.value = EmailAccountProvisioner.storage.getItem("name") ||
+                        nameElement.value;
     EmailAccountProvisioner.saveName();
 
     // Pretend like we've typed something into the search input to set the
     // initial enabled/disabled state of the search button.
     EmailAccountProvisioner.onSearchInputOrProvidersChanged();
 
     document.getElementById("window").style.height = (window.innerHeight - 1) + "px";
 
--- a/mailnews/base/prefs/content/aw-identity.js
+++ b/mailnews/base/prefs/content/aw-identity.js
@@ -121,26 +121,18 @@ function setEmailDescriptionText()
     // Create a text nodes with text to be displayed
     var emailDescTextNode       =  document.createTextNode(displayText);
 
     // Display the dynamically generated text for email description
     emailDescText.appendChild(emailDescTextNode);
 }
 
 function checkForFullName() {
-    var name = document.getElementById("fullName");
-    if (name.value=="") {
-        try {
-            var userInfo = Cc["@mozilla.org/userinfo;1"].getService(Ci.nsIUserInfo);
-            name.value = userInfo.fullname;
-        }
-        catch (ex) {
-            // dump ("checkForFullName failed: " + ex + "\n");
-        }
-    }
+  // var name = document.getElementById("fullName");
+  // We currently have no way to propose any useful name here.
 }
 
 function checkForEmail()
 {
     var email = document.getElementById("email");
     var pageData = parent.GetPageData();
     if (pageData && pageData.identity && pageData.identity.email) {
         email.value = pageData.identity.email.value;