disable filters with invalid move targets 46876 r=alecf

This commit is contained in:
bienvenu%netscape.com 2000-08-17 20:10:51 +00:00
Родитель cb1cc720c9
Коммит 112ee2c618
2 изменённых файлов: 25 добавлений и 0 удалений

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

@ -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;