Bug 1597130 - remove unused MsgNewFolder() in mail/base/content/mailWindowOverlay.js. r=jorgk
authoraceman <acelists@atlas.sk>
Mon, 18 Nov 2019 12:45:00 +0100
changeset 36675 f5bd174b047b170cec34c4a4b465efb182fec971
parent 36674 1628c49941d6699b96b2fff5688c9b8625133f4b
child 36676 d5118af449e7fbf0f750b3ae045324470cfcd284
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)
reviewersjorgk
bugs1597130
Bug 1597130 - remove unused MsgNewFolder() in mail/base/content/mailWindowOverlay.js. r=jorgk
mail/base/content/mailWindowOverlay.js
--- a/mail/base/content/mailWindowOverlay.js
+++ b/mail/base/content/mailWindowOverlay.js
@@ -2125,82 +2125,16 @@ function MsgCreateFilter() {
   let emailAddress = MailServices.headerParser.extractHeaderAddressMailboxes(
     msgHdr.author
   );
   if (emailAddress) {
     top.MsgFilters(emailAddress, msgHdr.folder);
   }
 }
 
-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();
 
   if (FeedMessageHandler.isFeedFolder(preselectedFolder)) {
     // Open feed subscription dialog.
     openSubscriptionsDialog(preselectedFolder);
   } else {