Fixing bug 87396. Today, when a new IMAP account is created special folder prefs are pointed to the server. This will be a problem for ISPs who do not want allow any folder creation on their servers and it is not very user friendly experience for end user in such a case. This check in allows ISPs to turn off that default setting to point to server via rdf file. Local folders will be used as home for special folders in such cases. r,sr=sspitzer a=chofmann

This commit is contained in:
racham%netscape.com 2001-06-23 21:11:52 +00:00
parent e7f7b7be4b
commit a6b7db0294
13 changed files with 38 additions and 67 deletions

View File

@ -15,6 +15,7 @@
<NC:type>imap</NC:type>
<NC:rememberPassword>false</NC:rememberPassword>
<NC:redirectorType>aol</NC:redirectorType>
<NC:defaultCopiesAndFoldersPrefsToServer>false</NC:defaultCopiesAndFoldersPrefsToServer>
<NC:ServerType-imap>
<NC:nsIImapIncomingServer>
<NC:deleteModel>2</NC:deleteModel>

View File

@ -497,10 +497,8 @@ function verifyLocalFoldersAccount(account) {
var server = account.incomingServer;
var identity = account.identities.QueryElementAt(0, Components.interfaces.nsIMsgIdentity);
// use server type to get the protocol info
var protocolinfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + server.type].getService(Components.interfaces.nsIMsgProtocolInfo);
// for this protocol, do we default the folder prefs to this server, or to the "Local Folders" server
defaultCopiesAndFoldersPrefsToServer = protocolinfo.defaultCopiesAndFoldersPrefsToServer;
// for this server, do we default the folder prefs to this server, or to the "Local Folders" server
var defaultCopiesAndFoldersPrefsToServer = server.defaultCopiesAndFoldersPrefsToServer;
if (!localMailServer) {
// dump("Creating local mail account\n");

View File

@ -339,11 +339,10 @@ function setPickersState(enablePickerId, disablePickerId, event)
if (!account) return;
var server = account.incomingServer;
var protocolInfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + server.type].getService(Components.interfaces.nsIMsgProtocolInfo);
// if special folders are not to be made on the server,
// then Local Folders is the home for it's special folders
if (!protocolInfo.defaultCopiesAndFoldersPrefsToServer) {
if (!server.defaultCopiesAndFoldersPrefsToServer) {
selectedElementUri = parent.accountManager.localFoldersServer.serverURI;
}
else

View File

@ -240,6 +240,20 @@ interface nsIMsgIncomingServer : nsISupports {
/* does this server have disk space settings? */
readonly attribute boolean supportsDiskSpace;
/**
* If the server supports Fcc/Sent/etc, default prefs can point to
* the server. Otherwise, copies and folders prefs should point to
* Local Folders.
*
* By default this value is set to true via global pref 'allows_specialfolders_usage'
* (mailnews.js). For Nntp, the value is overridden to be false.
* If ISPs want to modify this value, they should do that in their rdf file
* by using this attribute. Please look at mozilla/mailnews/base/ispdata/aol.rdf for
* usage example.
*/
attribute boolean defaultCopiesAndFoldersPrefsToServer;
};
%{C++

View File

@ -74,12 +74,6 @@ interface nsIMsgProtocolInfo : nsISupports
*/
readonly attribute boolean canDuplicate;
/**
* Whether Fcc/Sent/etc should be on this server or
* on a local server
*/
readonly attribute boolean defaultCopiesAndFoldersPrefsToServer;
/* the default port
This is similar to nsIProtocolHanderl.defaultPort,
but for architectural reasons, there is a mail-specific interface to this.

View File

@ -1353,6 +1353,9 @@ NS_IMPL_SERVERPREF_BOOL(nsMsgIncomingServer, EmptyTrashOnExit,
"empty_trash_on_exit");
NS_IMPL_SERVERPREF_BOOL(nsMsgIncomingServer, CanDelete, "canDelete");
NS_IMPL_SERVERPREF_BOOL(nsMsgIncomingServer, LoginAtStartUp, "login_at_startup");
NS_IMPL_SERVERPREF_BOOL(nsMsgIncomingServer,
DefaultCopiesAndFoldersPrefsToServer,
"allows_specialfolders_usage");
NS_IMPL_SERVERPREF_BOOL(nsMsgIncomingServer,
LimitMessageSize,

View File

@ -3116,15 +3116,6 @@ nsImapService::GetNeedToBuildSpecialFolderURIs(PRBool *needToBuildSpecialFolderU
return NS_OK;
}
NS_IMETHODIMP
nsImapService::GetDefaultCopiesAndFoldersPrefsToServer(PRBool *aDefaultCopiesAndFoldersPrefsToServer)
{
NS_ENSURE_ARG_POINTER(aDefaultCopiesAndFoldersPrefsToServer);
// Need to create required special folders on the server. Return true.
*aDefaultCopiesAndFoldersPrefsToServer = PR_TRUE;
return NS_OK;
}
NS_IMETHODIMP
nsImapService::GetSpecialFoldersDeletionAllowed(PRBool *specialFoldersDeletionAllowed)
{

View File

@ -643,17 +643,6 @@ nsMovemailService::GetCanDuplicate(PRBool *aCanDuplicate)
return NS_OK;
}
NS_IMETHODIMP
nsMovemailService::GetDefaultCopiesAndFoldersPrefsToServer(PRBool *aDefaultCopiesAndFoldersPrefsToServer)
{
NS_ENSURE_ARG_POINTER(aDefaultCopiesAndFoldersPrefsToServer);
// when a "movemail" server is created (like "Local Folders")
// the copies and folder prefs for the associated identity
// point to folders on this server.
*aDefaultCopiesAndFoldersPrefsToServer = PR_TRUE;
return NS_OK;
}
NS_IMETHODIMP
nsMovemailService::GetDefaultDoBiff(PRBool *aDoBiff)
{

View File

@ -171,17 +171,6 @@ nsNoneService::GetCanGetMessages(PRBool *aCanGetMessages)
return NS_OK;
}
NS_IMETHODIMP
nsNoneService::GetDefaultCopiesAndFoldersPrefsToServer(PRBool *aDefaultCopiesAndFoldersPrefsToServer)
{
NS_ENSURE_ARG_POINTER(aDefaultCopiesAndFoldersPrefsToServer);
// when a "none" server is created (like "Local Folders")
// the copies and folder prefs for the associated identity
// point to folders on this server.
*aDefaultCopiesAndFoldersPrefsToServer = PR_TRUE;
return NS_OK;
}
NS_IMETHODIMP
nsNoneService::GetDefaultDoBiff(PRBool *aDoBiff)
{

View File

@ -576,17 +576,6 @@ nsPop3Service::GetDefaultServerPort(PRBool isSecure, PRInt32 *aPort)
return GetDefaultPort(aPort);
}
NS_IMETHODIMP
nsPop3Service::GetDefaultCopiesAndFoldersPrefsToServer(PRBool *aDefaultCopiesAndFoldersPrefsToServer)
{
NS_ENSURE_ARG_POINTER(aDefaultCopiesAndFoldersPrefsToServer);
// when a pop3 server is created, the copies and folder prefs for the associated identity
// point to folders on this server.
// when we create a pop server, we give it its own Drafts, Sent, Templates, etc folders.
*aDefaultCopiesAndFoldersPrefsToServer = PR_TRUE;
return NS_OK;
}
NS_IMETHODIMP
nsPop3Service::GetSpecialFoldersDeletionAllowed(PRBool *specialFoldersDeletionAllowed)
{

View File

@ -1565,3 +1565,19 @@ nsNntpIncomingServer::GetOfflineSupportLevel(PRInt32 *aSupportLevel)
*aSupportLevel = OFFLINE_SUPPORT_LEVEL_EXTENDED;
return NS_OK;
}
NS_IMETHODIMP
nsNntpIncomingServer::GetDefaultCopiesAndFoldersPrefsToServer(PRBool *aCopiesAndFoldersOnServer)
{
NS_ENSURE_ARG_POINTER(aCopiesAndFoldersOnServer);
/**
* When a news account is created, the copies and folder prefs for the
* associated identity don't point to folders on the server.
* This makes sense, since there is no "Drafts" folder on a news server.
* They'll point to the ones on "Local Folders"
*/
*aCopiesAndFoldersOnServer = PR_FALSE;
return NS_OK;
}

View File

@ -74,6 +74,7 @@ public:
NS_IMETHODIMP ForgetPassword();
NS_IMETHOD GetCanSearchMessages(PRBool *canSearchMessages);
NS_IMETHOD GetOfflineSupportLevel(PRInt32 *aSupportLevel);
NS_IMETHOD GetDefaultCopiesAndFoldersPrefsToServer(PRBool *aCopiesAndFoldersOnServer);
protected:
nsresult CreateProtocolInstance(nsINNTPProtocol ** aNntpConnection, nsIURI *url,

View File

@ -1378,19 +1378,6 @@ nsNntpService::GetNeedToBuildSpecialFolderURIs(PRBool *needToBuildSpecialFolderU
return NS_OK;
}
NS_IMETHODIMP
nsNntpService::GetDefaultCopiesAndFoldersPrefsToServer(PRBool *aDefaultCopiesAndFoldersPrefsToServer)
{
NS_ENSURE_ARG_POINTER(aDefaultCopiesAndFoldersPrefsToServer);
// when a news account is created, the copies and folder prefs for the associated identity
// don't point to folders on the server.
// this makes sense, since there is no "Drafts" folder on a news server.
// they'll point to the ones on "Local Folders"
*aDefaultCopiesAndFoldersPrefsToServer = PR_FALSE;
return NS_OK;
}
NS_IMETHODIMP
nsNntpService::GetSpecialFoldersDeletionAllowed(PRBool *specialFoldersDeletionAllowed)
{