From 4329ae3337172a9fd126986c90b09a9eb3dc179b Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Mon, 27 Jul 2020 19:17:14 -0400 Subject: [MailNews] Allow ordering of accounts to respect mail.accountmanager.accounts --- mailnews/base/util/folderUtils.jsm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mailnews/base') diff --git a/mailnews/base/util/folderUtils.jsm b/mailnews/base/util/folderUtils.jsm index 62fb7700b..9d2918a7a 100644 --- a/mailnews/base/util/folderUtils.jsm +++ b/mailnews/base/util/folderUtils.jsm @@ -12,6 +12,7 @@ this.EXPORTED_SYMBOLS = ["getFolderProperties", "getSpecialFolderString", Components.utils.import("resource:///modules/mailServices.js"); Components.utils.import("resource:///modules/iteratorUtils.jsm"); +Components.utils.import("resource://gre/modules/Services.jsm"); /** * Returns a string representation of a folder's "special" type. @@ -169,8 +170,14 @@ function allAccountsSorted(aExcludeIMAccounts) { return a.incomingServer.type != "im"; }); } + + // Sort the accounts else will respect the order in mail.accountmanager.accounts + if (Services.prefs.getBoolPref("mail.accountmanager.accounts.ordered", true)) { + accountList = accountList.sort(compareAccounts); + } + - return accountList.sort(compareAccounts); + return accountList; } /** -- cgit v1.2.3 From 4a960879c858a96c8f77caeadb558d7eeb487756 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Mon, 27 Jul 2020 19:18:35 -0400 Subject: [MailNews] Allow setting "Local Folders" as always the first displayed account --- mailnews/base/util/folderUtils.jsm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mailnews/base') diff --git a/mailnews/base/util/folderUtils.jsm b/mailnews/base/util/folderUtils.jsm index 9d2918a7a..06e8e4bf2 100644 --- a/mailnews/base/util/folderUtils.jsm +++ b/mailnews/base/util/folderUtils.jsm @@ -176,6 +176,10 @@ function allAccountsSorted(aExcludeIMAccounts) { accountList = accountList.sort(compareAccounts); } + // Set "Local Folders" as always the first displayed account + if (Services.prefs.getBoolPref("mail.accountmanager.localfolderfirst", false)) { + accountList.unshift(accountList.splice(accountList.findIndex(item => item.key === "account1"), 1)[0]); + } return accountList; } -- cgit v1.2.3 From 1ef64f9ea3396f29b996da0293f96030bd4ac2a5 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Mon, 27 Jul 2020 20:36:11 -0400 Subject: Follow up to 39be34c06 - The check sound be if not ordered FINE! I'll go to bed already... --- mailnews/base/util/folderUtils.jsm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mailnews/base') diff --git a/mailnews/base/util/folderUtils.jsm b/mailnews/base/util/folderUtils.jsm index 06e8e4bf2..f549bf655 100644 --- a/mailnews/base/util/folderUtils.jsm +++ b/mailnews/base/util/folderUtils.jsm @@ -172,7 +172,7 @@ function allAccountsSorted(aExcludeIMAccounts) { } // Sort the accounts else will respect the order in mail.accountmanager.accounts - if (Services.prefs.getBoolPref("mail.accountmanager.accounts.ordered", true)) { + if (!Services.prefs.getBoolPref("mail.accountmanager.accounts.ordered", false)) { accountList = accountList.sort(compareAccounts); } -- cgit v1.2.3