Bug 863617 - Fix leftovers from switch to Services.jsm and mailServices.js: smtp remnants. r=mconley,a=Standard8 CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Tue, 09 Jul 2013 21:06:03 +0200
changeset 12703 65c5bfb05484d04ba58d906559a0177de392740c
parent 12702 1164d550d2253e7e7246ae26913362a9427adca8
child 12704 67f97998db4722025dee23a2be04cdcdf48a056c
push id9323
push userbugzilla@standard8.plus.com
push dateThu, 11 Jul 2013 13:06:37 +0000
treeherdercomm-central@65c5bfb05484 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, Standard8
bugs863617
Bug 863617 - Fix leftovers from switch to Services.jsm and mailServices.js: smtp remnants. r=mconley,a=Standard8 CLOSED TREE
mailnews/base/prefs/content/aw-done.js
mailnews/base/prefs/content/aw-outgoing.js
--- a/mailnews/base/prefs/content/aw-done.js
+++ b/mailnews/base/prefs/content/aw-done.js
@@ -1,13 +1,15 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+Components.utils.import("resource:///modules/mailServices.js");
+
 var gPrefsBundle;
 
 function donePageInit() {
     var pageData = parent.GetPageData();
     var currentAccountData = gCurrentAccountData;
 
     if ("testingIspServices" in this) {
       if (testingIspServices()) {
@@ -120,17 +122,17 @@ function donePageInit() {
                  currentAccountData && 
                  currentAccountData.incomingServer.type)
                 incomingServerType = currentAccountData.incomingServer.type;
         }
         setDivTextFromForm("server.type", incomingServerType.toUpperCase());
 
         var smtpServerName="";
         if (pageData.server && pageData.server.smtphostname) {
-          var smtpServer = parent.smtpService.defaultServer;
+          let smtpServer = MailServices.smtp.defaultServer;
           smtpServerName = pageData.server.smtphostname.value;
           if (!smtpServerName && smtpServer && smtpServer.hostname)
               smtpServerName = smtpServer.hostname;
         }
         setDivTextFromForm("smtpServer.name", smtpServerName);
     }
     else {
         setDivTextFromForm("server.name", null);
--- a/mailnews/base/prefs/content/aw-outgoing.js
+++ b/mailnews/base/prefs/content/aw-outgoing.js
@@ -1,14 +1,15 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 Components.utils.import("resource:///modules/hostnameUtils.jsm");
+Components.utils.import("resource:///modules/mailServices.js");
 
 var gProtocolInfo = null;
 var gPrefsBundle;
 
 function outgoingPageValidate() {
   let canAdvance = true;
 
   let smtpServer = document.getElementById("smtphostname").value;
@@ -40,18 +41,18 @@ function outgoingPageInit() {
     var pageData = parent.GetPageData();
 
     var smtpServer = null;
     var smtpCreateNewServer = gCurrentAccountData && gCurrentAccountData.smtpCreateNewServer;
 
     // Don't use the default smtp server if smtp server creation was explicitly
     // requested in isp rdf.
     // If we're reusing the default smtp we should not set the smtp hostname.
-    if (parent.smtpService.defaultServer && !smtpCreateNewServer) {
-      smtpServer = parent.smtpService.defaultServer;
+    if (MailServices.smtp.defaultServer && !smtpCreateNewServer) {
+      smtpServer = MailServices.smtp.defaultServer;
       setPageData(pageData, "identity", "smtpServerKey", "");
     }
 
     var noSmtpBox = document.getElementById("noSmtp");
     var haveSmtpBox = document.getElementById("haveSmtp");
 
     var boxToHide;
     var boxToShow;
@@ -77,17 +78,17 @@ function outgoingPageInit() {
 
     if (boxToHide)
       boxToHide.setAttribute("hidden", "true");
 
     if (boxToShow)
       boxToShow.removeAttribute("hidden");
 
     var smtpNameInput = document.getElementById("smtpusername");
-    var smtpServer = parent.smtpService.defaultServer;
+    let smtpServer = MailServices.smtp.defaultServer;
     if (smtpServer && smtpServer.hostname && smtpServer.username) {
       // we have a default SMTP server, so modify and show the static text
       // and store the username for the default server in the textbox.
       modifyStaticText(smtpServer.username, "2")
       hideShowLoginSettings(2, 1, 3);
       smtpNameInput.value = smtpServer.username;
     }
     else {