From c43f45b36afc044aee0c77a7b218a6be6d174ae3 Mon Sep 17 00:00:00 2001 From: "bienvenu%netscape.com" Date: Fri, 12 Nov 1999 01:29:26 +0000 Subject: [PATCH] fix filters firing on read message, r=mscott, 17838 git-svn-id: svn://10.0.0.236/trunk@53293 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/imap/src/nsImapMailFolder.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp index 763842a4f4e..171bc2d22e1 100644 --- a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp @@ -1511,13 +1511,19 @@ NS_IMETHODIMP nsImapMailFolder::NormalEndHeaderParseStream(nsIImapProtocol* // If this is the inbox, try to apply filters. if (mFlags & MSG_FOLDER_FLAG_INBOX) { - rv = m_msgParser->GetAllHeaders(&headers, &headersSize); + PRUint32 msgFlags; - if (NS_SUCCEEDED(rv) && headers) + newMsgHdr->GetFlags(&msgFlags); + if (!(msgFlags & MSG_FLAG_READ)) // only fire on unread msgs { - if (m_filterList) - m_filterList->ApplyFiltersToHdr(nsMsgFilterType::InboxRule, newMsgHdr, this, mDatabase, - headers, headersSize, this); + rv = m_msgParser->GetAllHeaders(&headers, &headersSize); + + if (NS_SUCCEEDED(rv) && headers) + { + if (m_filterList) + m_filterList->ApplyFiltersToHdr(nsMsgFilterType::InboxRule, newMsgHdr, this, mDatabase, + headers, headersSize, this); + } } } // here we need to tweak flags from uid state..