Bug 1597130 - remove unused MsgNewFolder() in mail/base/content/mailWindowOverlay.js. r=jorgk
This commit is contained in:
Родитель
47aeb7c75c
Коммит
f292c29904
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче