Bug 1599446 - Feed subscriptions empty for new account r=alta88
authorIan Neal <iann_cvs@blueyonder.co.uk>
Mon, 02 Dec 2019 10:29:30 +1300
changeset 36760 a0470cab33c08920a9b7644048e36144ce05d396
parent 36759 8c2f8de771068d5bc849a4e1c5c33329f1e7ea01
child 36761 f83cf1dd1132b33fe33787534097fd088fcccb6f
push id2534
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:52:51 +0000
treeherdercomm-beta@055c50840778 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersalta88
bugs1599446
Bug 1599446 - Feed subscriptions empty for new account r=alta88
mailnews/base/prefs/content/AccountWizard.js
--- a/mailnews/base/prefs/content/AccountWizard.js
+++ b/mailnews/base/prefs/content/AccountWizard.js
@@ -45,16 +45,17 @@ var okCallback = null;
    accounttype -> identity -> server -> login -> accname -> done
                              \-> newsserver ----/
 
    where the accounttype determines which path to take
    (server vs. newsserver)
 */
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { FeedUtils } = ChromeUtils.import("resource:///modules/FeedUtils.jsm");
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
 var contentWindow;
 
 var gPageData;
 
@@ -422,16 +423,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 +
       ", " +