don't count junk mail as new mail, sr=mscott, a=asa 282477, sr=mscott, a=asa
git-svn-id: svn://10.0.0.236/trunk@175922 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -3376,6 +3376,8 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFilterHit(nsIMsgFilter *filter, nsIMsgWindo
|
||||
NS_ASSERTION(keysToClassify, "error getting key bucket");
|
||||
if (keysToClassify)
|
||||
keysToClassify->Add(msgKey);
|
||||
if (junkScore == 100)
|
||||
msgIsNew = PR_FALSE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -4331,7 +4333,11 @@ nsresult nsImapMailFolder::HandleCustomFlags(nsMsgKey uidOfMessage, nsIMsgDBHdr
|
||||
mDatabase->SetStringProperty(uidOfMessage, "junkscore", "0");
|
||||
// ### TODO: we really should parse the keywords into space delimited keywords before checking
|
||||
else if (FindInReadable(NS_LITERAL_CSTRING("Junk"), keywords.BeginReading(b), keywords.EndReading(e)))
|
||||
{
|
||||
PRUint32 newFlags;
|
||||
dbHdr->AndFlags(~MSG_FLAG_NEW, &newFlags);
|
||||
mDatabase->SetStringProperty(uidOfMessage, "junkscore", "100");
|
||||
}
|
||||
else
|
||||
messageClassified = PR_FALSE;
|
||||
if (messageClassified)
|
||||
|
||||
@@ -1802,6 +1802,8 @@ NS_IMETHODIMP nsParseNewMailState::ApplyFilterHit(nsIMsgFilter *filter, nsIMsgWi
|
||||
PRInt32 junkScore;
|
||||
filterAction->GetJunkScore(&junkScore);
|
||||
junkScoreStr.AppendInt(junkScore);
|
||||
if (junkScore > 50)
|
||||
msgIsNew = PR_FALSE;
|
||||
nsMsgKey msgKey;
|
||||
msgHdr->GetMessageKey(&msgKey);
|
||||
m_mailDB->SetStringProperty(msgKey, "junkscore", junkScoreStr.get());
|
||||
@@ -2093,7 +2095,7 @@ nsresult nsParseNewMailState::MoveIncorporatedMessage(nsIMsgDBHdr *mailHdr,
|
||||
return NS_MSG_ERROR_WRITING_MAIL_FOLDER;
|
||||
}
|
||||
|
||||
PRBool movedMsgIsNew = PR_TRUE;
|
||||
PRBool movedMsgIsNew = PR_FALSE;
|
||||
// if we have made it this far then the message has successfully been written to the new folder
|
||||
// now add the header to the destMailDB.
|
||||
if (NS_SUCCEEDED(rv) && destMailDB)
|
||||
@@ -2109,12 +2111,14 @@ nsresult nsParseNewMailState::MoveIncorporatedMessage(nsIMsgDBHdr *mailHdr,
|
||||
newHdr->GetFlags(&newFlags);
|
||||
if (! (newFlags & MSG_FLAG_READ))
|
||||
{
|
||||
newHdr->OrFlags(MSG_FLAG_NEW, &newFlags);
|
||||
destMailDB->AddToNewList(newMsgPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
movedMsgIsNew = PR_FALSE;
|
||||
nsXPIDLCString junkScoreStr;
|
||||
(void) newHdr->GetStringProperty("junkscore", getter_Copies(junkScoreStr));
|
||||
if (atoi(junkScoreStr.get()) < 50)
|
||||
{
|
||||
newHdr->OrFlags(MSG_FLAG_NEW, &newFlags);
|
||||
destMailDB->AddToNewList(newMsgPos);
|
||||
movedMsgIsNew = PR_TRUE;
|
||||
}
|
||||
}
|
||||
destMailDB->AddNewHdrToDB(newHdr, PR_TRUE);
|
||||
}
|
||||
|
||||
@@ -839,8 +839,13 @@ nsPop3Sink::IncorporateComplete(nsIMsgWindow *aMsgWindow, PRInt32 aSize)
|
||||
hdr->GetFlags(&newFlags);
|
||||
if (! (newFlags & MSG_FLAG_READ))
|
||||
{
|
||||
hdr->OrFlags(MSG_FLAG_NEW, &newFlags);
|
||||
m_newMailParser->m_mailDB->AddToNewList(newMsgPos);
|
||||
nsXPIDLCString junkScoreStr;
|
||||
(void) hdr->GetStringProperty("junkscore", getter_Copies(junkScoreStr));
|
||||
if (atoi(junkScoreStr.get()) < 50)
|
||||
{
|
||||
hdr->OrFlags(MSG_FLAG_NEW, &newFlags);
|
||||
m_newMailParser->m_mailDB->AddToNewList(newMsgPos);
|
||||
}
|
||||
}
|
||||
m_newMailParser->m_mailDB->AddNewHdrToDB(hdr, PR_TRUE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user