mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-02 20:20:00 +00:00
fix part of 290237, make pre-canned filters for ISP Spam headers apply default junk actions, sr=mscott, a=asa
This commit is contained in:
parent
e998ef1a3d
commit
87920c2cfd
@ -1981,6 +1981,37 @@ nsMsgIncomingServer::ConfigureTemporaryServerSpamFilters(nsIMsgFilterList *filte
|
||||
if (newFilter && serverFilterTrustFlags & nsISpamSettings::TRUST_POSITIVES)
|
||||
{
|
||||
newFilter->SetTemporary(PR_TRUE);
|
||||
// check if we're supposed to move junk mail to junk folder; if so,
|
||||
// add filter action to do so.
|
||||
PRBool moveOnSpam, markAsReadOnSpam;
|
||||
spamSettings->GetMoveOnSpam(&moveOnSpam);
|
||||
if (moveOnSpam)
|
||||
{
|
||||
nsXPIDLCString spamFolderURI;
|
||||
rv = spamSettings->GetSpamFolderURI(getter_Copies(spamFolderURI));
|
||||
if (NS_SUCCEEDED(rv) && (!spamFolderURI.IsEmpty()))
|
||||
{
|
||||
nsCOMPtr <nsIMsgRuleAction> moveAction;
|
||||
rv = newFilter->CreateAction(getter_AddRefs(moveAction));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
moveAction->SetType(nsMsgFilterAction::MoveToFolder);
|
||||
moveAction->SetTargetFolderUri(spamFolderURI);
|
||||
newFilter->AppendAction(moveAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
spamSettings->GetMarkAsReadOnSpam(&markAsReadOnSpam);
|
||||
if (markAsReadOnSpam)
|
||||
{
|
||||
nsCOMPtr <nsIMsgRuleAction> markAsReadAction;
|
||||
rv = newFilter->CreateAction(getter_AddRefs(markAsReadAction));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
markAsReadAction->SetType(nsMsgFilterAction::MarkRead);
|
||||
newFilter->AppendAction(markAsReadAction);
|
||||
}
|
||||
}
|
||||
filterList->InsertFilterAt(0, newFilter);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user