allow isp rdf files to specify names of special folders, patch by y.rouillard@laposte.net, r/sr=bienvenu 328180

This commit is contained in:
bienvenu%nventure.com 2006-04-12 18:25:31 +00:00
Родитель f66d69106a
Коммит 5faf1a7730
1 изменённых файлов: 17 добавлений и 10 удалений

Просмотреть файл

@ -218,7 +218,7 @@ function FinishAccount()
// transfer all attributes from the accountdata // transfer all attributes from the accountdata
finishAccount(gCurrentAccount, accountData); finishAccount(gCurrentAccount, accountData);
setupCopiesAndFoldersServer(gCurrentAccount, getCurrentServerIsDeferred(pageData)); setupCopiesAndFoldersServer(gCurrentAccount, getCurrentServerIsDeferred(pageData), accountData);
if (!serverIsNntp(pageData)) if (!serverIsNntp(pageData))
EnableCheckMailAtStartUpIfNeeded(gCurrentAccount); EnableCheckMailAtStartUpIfNeeded(gCurrentAccount);
@ -609,7 +609,7 @@ function verifyLocalFoldersAccount()
} }
function setupCopiesAndFoldersServer(account, accountIsDeferred) function setupCopiesAndFoldersServer(account, accountIsDeferred, accountData)
{ {
try { try {
var server = account.incomingServer; var server = account.incomingServer;
@ -636,7 +636,7 @@ function setupCopiesAndFoldersServer(account, accountIsDeferred)
copiesAndFoldersServer = am.localFoldersServer; copiesAndFoldersServer = am.localFoldersServer;
} }
setDefaultCopiesAndFoldersPrefs(identity, copiesAndFoldersServer); setDefaultCopiesAndFoldersPrefs(identity, copiesAndFoldersServer, accountData);
} catch (ex) { } catch (ex) {
// return false (meaning we did not setupCopiesAndFoldersServer) // return false (meaning we did not setupCopiesAndFoldersServer)
@ -647,7 +647,7 @@ function setupCopiesAndFoldersServer(account, accountIsDeferred)
return true; return true;
} }
function setDefaultCopiesAndFoldersPrefs(identity, server) function setDefaultCopiesAndFoldersPrefs(identity, server, accountData)
{ {
dump("finding folders on server = " + server.hostName + "\n"); dump("finding folders on server = " + server.hostName + "\n");
@ -690,10 +690,17 @@ function setDefaultCopiesAndFoldersPrefs(identity, server)
var folderDelim = "/"; var folderDelim = "/";
/* we use internal names known to everyone like Sent, Templates and Drafts */ /* we use internal names known to everyone like Sent, Templates and Drafts */
/* if folder names were already given in isp rdf, we use them,
otherwise we use internal names known to everyone like Sent, Templates and Drafts */
var draftFolder = (accountData.identity && accountData.identity.draftFolder ? accountData.identity.draftFolder : "Drafts");
var stationeryFolder = (accountData.identity && accountData.identity.stationeryFolder ? accountData.identity.stationeryFolder : "Templates");
var fccFolder = (accountData.identity && accountData.identity.fccFolder ? accountData.identity.fccFolder : "Sent");
identity.draftFolder = msgFolder.server.serverURI+ folderDelim + draftFolder;
identity.stationeryFolder = msgFolder.server.serverURI+ folderDelim + stationeryFolder;
identity.fccFolder = msgFolder.server.serverURI+ folderDelim + fccFolder;
identity.draftFolder = msgFolder.server.serverURI+ folderDelim + "Drafts";
identity.stationeryFolder = msgFolder.server.serverURI+ folderDelim + "Templates";
identity.fccFolder = msgFolder.server.serverURI+ folderDelim + "Sent";
} }
else { else {
// these hex values come from nsMsgFolderFlags.h // these hex values come from nsMsgFolderFlags.h
@ -710,9 +717,9 @@ function setDefaultCopiesAndFoldersPrefs(identity, server)
dump("stationeryFolder = " + identity.stationeryFolder + "\n"); dump("stationeryFolder = " + identity.stationeryFolder + "\n");
} }
identity.fccFolderPickerMode = gDefaultSpecialFolderPickerMode; identity.fccFolderPickerMode = (accountData.identity && accountData.identity.fccFolder ? 1 : gDefaultSpecialFolderPickerMode);
identity.draftsFolderPickerMode = gDefaultSpecialFolderPickerMode; identity.draftsFolderPickerMode = (accountData.identity && accountData.identity.draftFolder ? 1 : gDefaultSpecialFolderPickerMode);
identity.tmplFolderPickerMode = gDefaultSpecialFolderPickerMode; identity.tmplFolderPickerMode = (accountData.identity && accountData.identity.stationeryFolder ? 1 : gDefaultSpecialFolderPickerMode);
} }
function AccountExists(userName,hostName,serverType) function AccountExists(userName,hostName,serverType)