зеркало из https://github.com/mozilla/pjs.git
disable filters with invalid move targets 46876 r=alecf
This commit is contained in:
Родитель
cb1cc720c9
Коммит
112ee2c618
|
@ -2492,6 +2492,18 @@ nsresult nsImapMailFolder::MoveIncorporatedMessage(nsIMsgDBHdr *mailHdr,
|
|||
|
||||
if (destIFolder)
|
||||
{
|
||||
// check if the destination is a real folder (by checking for null parent)
|
||||
// and if it can file messages (e.g., servers or news folders can't file messages).
|
||||
// Or read only imap folders...
|
||||
PRBool canFileMessages = PR_TRUE;
|
||||
nsCOMPtr<nsIFolder> parentFolder;
|
||||
destIFolder->GetParent(getter_AddRefs(parentFolder));
|
||||
destIFolder->GetCanFileMessages(&canFileMessages);
|
||||
if (!parentFolder || !canFileMessages)
|
||||
{
|
||||
filter->SetEnabled(PR_FALSE);
|
||||
return NS_MSG_NOT_A_MAIL_FOLDER;
|
||||
}
|
||||
// put the header into the source db, since it needs to be there when we copy it
|
||||
// and we need a valid header to pass to StartAsyncCopyMessagesInto
|
||||
nsMsgKey keyToFilter;
|
||||
|
|
|
@ -1843,6 +1843,19 @@ nsresult nsParseNewMailState::MoveIncorporatedMessage(nsIMsgDBHdr *mailHdr,
|
|||
if (NS_FAILED(err))
|
||||
return err;
|
||||
|
||||
// check if the destination is a real folder (by checking for null parent)
|
||||
// and if it can file messages (e.g., servers or news folders can't file messages).
|
||||
// Or read only imap folders...
|
||||
PRBool canFileMessages = PR_TRUE;
|
||||
nsCOMPtr<nsIFolder> parentFolder;
|
||||
destIFolder->GetParent(getter_AddRefs(parentFolder));
|
||||
destIFolder->GetCanFileMessages(&canFileMessages);
|
||||
if (!parentFolder || !canFileMessages)
|
||||
{
|
||||
filter->SetEnabled(PR_FALSE);
|
||||
return NS_MSG_NOT_A_MAIL_FOLDER;
|
||||
}
|
||||
|
||||
nsCOMPtr <nsIFileSpec> destIFolderSpec;
|
||||
|
||||
nsFileSpec destFolderSpec;
|
||||
|
|
Загрузка…
Ссылка в новой задаче