From f292c29904f19ba146e9853024ce3b83f22d88d5 Mon Sep 17 00:00:00 2001 From: aceman Date: Mon, 18 Nov 2019 12:45:00 +0100 Subject: [PATCH] Bug 1597130 - remove unused MsgNewFolder() in mail/base/content/mailWindowOverlay.js. r=jorgk --- mail/base/content/mailWindowOverlay.js | 66 -------------------------- 1 file changed, 66 deletions(-) diff --git a/mail/base/content/mailWindowOverlay.js b/mail/base/content/mailWindowOverlay.js index 800d2f8244..e7a0dba2b9 100644 --- a/mail/base/content/mailWindowOverlay.js +++ b/mail/base/content/mailWindowOverlay.js @@ -2130,72 +2130,6 @@ function MsgCreateFilter() { } } -function MsgNewFolder(callBackFunctionName) { - var preselectedFolder = GetFirstSelectedMsgFolder(); - var dualUseFolders = true; - var server = null; - var destinationFolder = null; - - if (preselectedFolder) { - try { - server = preselectedFolder.server; - if (server) { - destinationFolder = getDestinationFolder(preselectedFolder, server); - - var imapServer = server.QueryInterface(Ci.nsIImapIncomingServer); - if (imapServer) { - dualUseFolders = imapServer.dualUseFolders; - } - } - } catch (e) { - dump("Exception: dualUseFolders = true\n"); - } - } - window.openDialog( - "chrome://messenger/content/newFolderDialog.xul", - "", - "chrome,titlebar,modal", - { - folder: destinationFolder, - dualUseFolders, - okCallback: callBackFunctionName, - } - ); -} - -function getDestinationFolder(preselectedFolder, server) { - var destinationFolder = null; - - if (!preselectedFolder.canCreateSubfolders) { - destinationFolder = server.rootMsgFolder; - - var verifyCreateSubfolders = null; - if (destinationFolder) { - verifyCreateSubfolders = destinationFolder.canCreateSubfolders; - } - - // In case the server cannot have subfolders, get default account and set - // its incoming server as parent folder. - if (!verifyCreateSubfolders) { - let defaultFolder = GetDefaultAccountRootFolder(); - let checkCreateSubfolders = null; - if (defaultFolder) { - checkCreateSubfolders = defaultFolder.canCreateSubfolders; - } - - if (checkCreateSubfolders) { - destinationFolder = defaultFolder; - } - } - } else { - // XXX TODO: why do we select the preselectedFolder - // even if it can't create subfolders? - destinationFolder = preselectedFolder; - } - - return destinationFolder; -} - /** Open subscribe window. */ function MsgSubscribe(folder) { var preselectedFolder = folder || GetFirstSelectedMsgFolder();