mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
fix for bug #189415.
treat the junk folder icon as special in the UI. (can't rename, can't delete, special icon, special placement. r/sr=bienvenu
This commit is contained in:
parent
4b6afc1483
commit
fd1a9d2975
@ -93,7 +93,7 @@ var FolderPaneController =
|
||||
catch (ex) {
|
||||
//dump("specialFolder failure: " + ex + "\n");
|
||||
}
|
||||
if (specialFolder == "Inbox" || specialFolder == "Trash" || specialFolder == "Drafts" || specialFolder == "Sent" || specialFolder == "Templates" || specialFolder == "Unsent Messages" || isServer == "true")
|
||||
if (specialFolder == "Inbox" || specialFolder == "Trash" || specialFolder == "Drafts" || specialFolder == "Sent" || specialFolder == "Templates" || specialFolder == "Unsent Messages" || specialFolder == "Junk" || isServer == "true")
|
||||
canDeleteThisFolder = false;
|
||||
else
|
||||
canDeleteThisFolder = true;
|
||||
@ -944,7 +944,8 @@ function MsgDeleteFolder()
|
||||
// do not allow deletion of special folders on imap accounts
|
||||
if ((specialFolder == "Sent" ||
|
||||
specialFolder == "Drafts" ||
|
||||
specialFolder == "Templates") &&
|
||||
specialFolder == "Templates" ||
|
||||
specialFolder == "Junk") &&
|
||||
!protocolInfo.specialFoldersDeletionAllowed)
|
||||
{
|
||||
var errorMessage = gMessengerBundle.getFormattedString("specialFolderDeletionErr",
|
||||
|
@ -1157,6 +1157,8 @@ nsMsgFolderDataSource::createFolderSpecialNode(nsIMsgFolder *folder,
|
||||
specialFolderString = NS_LITERAL_STRING("Drafts");
|
||||
else if (flags & MSG_FOLDER_FLAG_TEMPLATES)
|
||||
specialFolderString = NS_LITERAL_STRING("Templates");
|
||||
else if (flags & MSG_FOLDER_FLAG_JUNK)
|
||||
specialFolderString = NS_LITERAL_STRING("Junk");
|
||||
else {
|
||||
// XXX why do this at all? or just ""
|
||||
specialFolderString = NS_LITERAL_STRING("none");
|
||||
|
@ -832,7 +832,7 @@ nsMsgFolder::GetCanRename(PRBool *aResult)
|
||||
}
|
||||
//
|
||||
// check if the folder is a special folder
|
||||
// (Trash, Drafts, Unsent Messages, Inbox, Sent, Templates)
|
||||
// (Trash, Drafts, Unsent Messages, Inbox, Sent, Templates, Junk)
|
||||
// if it is, don't allow the user to rename it
|
||||
// (which includes dnd moving it with in the same server)
|
||||
//
|
||||
@ -848,7 +848,8 @@ nsMsgFolder::GetCanRename(PRBool *aResult)
|
||||
mFlags & MSG_FOLDER_FLAG_QUEUE ||
|
||||
mFlags & MSG_FOLDER_FLAG_INBOX ||
|
||||
mFlags & MSG_FOLDER_FLAG_SENTMAIL ||
|
||||
mFlags & MSG_FOLDER_FLAG_TEMPLATES) {
|
||||
mFlags & MSG_FOLDER_FLAG_TEMPLATES ||
|
||||
mFlags & MSG_FOLDER_FLAG_JUNK) {
|
||||
*aResult = PR_FALSE;
|
||||
}
|
||||
else {
|
||||
@ -1498,7 +1499,7 @@ NS_IMETHODIMP nsMsgFolder::SetPrefFlag()
|
||||
// tree hierarchy but in the rdf cache in case of the non-existing default
|
||||
// Sent, Drafts, and Templates folders. The resouce will be eventually
|
||||
// released when the rdf service shuts down. When we create the default
|
||||
// folders later on in the imap server, the subsequent GetResouce() of the
|
||||
// folders later on in the imap server, the subsequent GetResource() of the
|
||||
// same uri will get us the cached rdf resource which should have the folder
|
||||
// flag set appropriately.
|
||||
nsresult rv;
|
||||
@ -1541,6 +1542,10 @@ NS_IMETHODIMP nsMsgFolder::SetPrefFlag()
|
||||
rv = folder->SetFlag(MSG_FOLDER_FLAG_TEMPLATES);
|
||||
}
|
||||
}
|
||||
|
||||
// XXX TODO
|
||||
// JUNK RELATED
|
||||
// should we be using the spam settings to set the JUNK flag?
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -2824,10 +2829,12 @@ NS_IMETHODIMP nsMsgFolder::GetSortOrder(PRInt32 *order)
|
||||
*order = 3;
|
||||
else if (flags & MSG_FOLDER_FLAG_SENTMAIL)
|
||||
*order = 4;
|
||||
else if (flags & MSG_FOLDER_FLAG_TRASH)
|
||||
else if (flags & MSG_FOLDER_FLAG_JUNK)
|
||||
*order = 5;
|
||||
else
|
||||
else if (flags & MSG_FOLDER_FLAG_TRASH)
|
||||
*order = 6;
|
||||
else
|
||||
*order = 7;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1423,7 +1423,8 @@ NS_IMETHODIMP nsMsgLocalMailFolder::GetDeletable(PRBool *deletable)
|
||||
else if (mFlags & MSG_FOLDER_FLAG_INBOX ||
|
||||
mFlags & MSG_FOLDER_FLAG_DRAFTS ||
|
||||
mFlags & MSG_FOLDER_FLAG_TRASH ||
|
||||
mFlags & MSG_FOLDER_FLAG_TEMPLATES)
|
||||
mFlags & MSG_FOLDER_FLAG_TEMPLATES ||
|
||||
mFlags & MSG_FOLDER_FLAG_JUNK)
|
||||
*deletable = PR_FALSE;
|
||||
else *deletable = PR_TRUE;
|
||||
|
||||
@ -3305,6 +3306,7 @@ nsMsgLocalMailFolder::SetFlagsOnDefaultMailboxes(PRUint32 flags)
|
||||
if (flags & MSG_FOLDER_FLAG_QUEUE)
|
||||
setSubfolderFlag("Unsent Messages", MSG_FOLDER_FLAG_QUEUE);
|
||||
|
||||
// what about the Junk folder?
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user