Bug 1599446 - Feed subscriptions empty for new account. r=frg a=frg DONTBUILD CLOSED TREE default tip
authorIan Neal <iann_cvs@blueyonder.co.uk>
Thu, 12 Dec 2019 20:06:55 +0100
changeset 32388 af58459229997dc04d4b4171c429a4b0292740ba
parent 32387 6f606bccc2528de8f4e3828acedfa4e464e930cc
push id233
push userfrgrahl@gmx.net
push dateThu, 12 Dec 2019 19:07:36 +0000
treeherdercomm-esr60@af5845922999 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrg, frg
bugs1599446
Bug 1599446 - Feed subscriptions empty for new account. r=frg a=frg DONTBUILD CLOSED TREE
mailnews/base/prefs/content/AccountWizard.js
--- a/mailnews/base/prefs/content/AccountWizard.js
+++ b/mailnews/base/prefs/content/AccountWizard.js
@@ -36,16 +36,17 @@ var okCallback = null;
    accounttype -> identity -> server -> login -> accname -> done
                              \-> newsserver ----/
 
    where the accounttype determines which path to take
    (server vs. newsserver)
 */
 
 ChromeUtils.import("resource:///modules/mailServices.js");
+ChromeUtils.import("resource:///modules/FeedUtils.jsm");
 
 var contentWindow;
 
 var gPageData;
 
 var nsIMsgIdentity = Ci.nsIMsgIdentity;
 var nsIMsgIncomingServer = Ci.nsIMsgIncomingServer;
 var gPrefsBundle, gMessengerBundle;
@@ -385,16 +386,21 @@ function PageDataToAccountData(pageData,
 
 // given an accountData structure, create an account
 // (but don't fill in any fields, that's for finishAccount()
 function createAccount(accountData)
 {
   // Retrieve the server (data) from the account data.
   var server = accountData.incomingServer;
 
+  // Use createRssAccount for Feed accounts.
+  if (server.type == "rss") {
+    return FeedUtils.createRssAccount(server.prettyName);
+  }
+
   // for news, username is always null
   var username = (server.type == "nntp") ? null : server.username;
   dump("MailServices.accounts.createIncomingServer(" +
        username + ", " + server.hostName + ", " + server.type + ")\n");
   // Create a (actual) server.
   server = MailServices.accounts.createIncomingServer(username, server.hostName, server.type);
 
   dump("MailServices.accounts.createAccount()\n");