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();