fix 271729 add global inbox filters to automatically executed filters, sr=mscott

This commit is contained in:
bienvenu%nventure.com 2005-03-10 02:50:14 +00:00
Родитель 73751be39b
Коммит a35bb3ce97
2 изменённых файлов: 18 добавлений и 1 удалений

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

@ -1471,7 +1471,18 @@ nsParseNewMailState::Init(nsIMsgFolder *serverFolder, nsIMsgFolder *downloadFold
if (m_filterList) if (m_filterList)
{ {
rv = server->ConfigureTemporaryFilters(m_filterList); rv = server->ConfigureTemporaryFilters(m_filterList);
// NS_ASSERTION(NS_SUCCEEDED(rv), "failed to configure temp filters"); NS_ASSERTION(NS_SUCCEEDED(rv), "failed to configure temp filters");
}
// check if this server defers to another server, in which case
// we'll use that server's filters as well.
nsCOMPtr <nsIMsgFolder> deferredToRootFolder;
server->GetRootMsgFolder(getter_AddRefs(deferredToRootFolder));
if (rootMsgFolder != deferredToRootFolder)
{
nsCOMPtr <nsIMsgIncomingServer> deferredToServer;
deferredToRootFolder->GetServer(getter_AddRefs(deferredToServer));
if (deferredToServer)
deferredToServer->GetFilterList(aMsgWindow, getter_AddRefs(m_deferredToServerFilterList));
} }
} }
m_disableFilters = PR_FALSE; m_disableFilters = PR_FALSE;
@ -1596,6 +1607,11 @@ void nsParseNewMailState::ApplyFilters(PRBool *pMoved, nsIMsgWindow *msgWindow,
if (m_filterList) if (m_filterList)
matchTermStatus = m_filterList->ApplyFiltersToHdr(nsMsgFilterType::InboxRule, matchTermStatus = m_filterList->ApplyFiltersToHdr(nsMsgFilterType::InboxRule,
msgHdr, downloadFolder, m_mailDB, headers, headersSize, this, msgWindow); msgHdr, downloadFolder, m_mailDB, headers, headersSize, this, msgWindow);
if (!m_msgMovedByFilter && m_deferredToServerFilterList)
{
matchTermStatus = m_deferredToServerFilterList->ApplyFiltersToHdr(nsMsgFilterType::InboxRule,
msgHdr, downloadFolder, m_mailDB, headers, headersSize, this, msgWindow);
}
} }
} }
if (pMoved) if (pMoved)

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

@ -258,6 +258,7 @@ protected:
virtual int MarkFilteredMessageRead(nsIMsgDBHdr *msgHdr); virtual int MarkFilteredMessageRead(nsIMsgDBHdr *msgHdr);
void LogRuleHit(nsIMsgFilter *filter, nsIMsgDBHdr *msgHdr); void LogRuleHit(nsIMsgFilter *filter, nsIMsgDBHdr *msgHdr);
nsCOMPtr <nsIMsgFilterList> m_filterList; nsCOMPtr <nsIMsgFilterList> m_filterList;
nsCOMPtr <nsIMsgFilterList> m_deferredToServerFilterList;
nsCOMPtr <nsIMsgFolder> m_rootFolder; nsCOMPtr <nsIMsgFolder> m_rootFolder;
nsCOMPtr <nsIMsgWindow> m_msgWindow; nsCOMPtr <nsIMsgWindow> m_msgWindow;
nsCOMPtr <nsIMsgFolder> m_downloadFolder; nsCOMPtr <nsIMsgFolder> m_downloadFolder;