From bdfa31a32aa6e757e622403d1b8689fc7a38dd7a Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Mon, 9 Feb 2004 16:00:44 +0000 Subject: [PATCH] fix 206050 don't fire new mail notification for imap messages that are deleted or marked read by mail filters, sr=mscott --- mailnews/imap/src/nsImapMailFolder.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mailnews/imap/src/nsImapMailFolder.cpp b/mailnews/imap/src/nsImapMailFolder.cpp index 3e9e2a4f3ba8..2a9303c89d85 100644 --- a/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mailnews/imap/src/nsImapMailFolder.cpp @@ -3003,6 +3003,8 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFilterHit(nsIMsgFilter *filter, nsIMsgWindo if (m_filterList && numActions) (void)m_filterList->GetLoggingEnabled(&loggingEnabled); + PRBool msgIsNew = PR_TRUE; + for (PRUint32 actionIndex = 0; actionIndex < numActions && *applyMore; actionIndex++) { nsCOMPtr filterAction; @@ -3051,6 +3053,7 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFilterHit(nsIMsgFilter *filter, nsIMsgWindo StoreImapFlags(kImapMsgSeenFlag | kImapMsgDeletedFlag, PR_TRUE, keysToFlag.GetArray(), keysToFlag.GetSize()); m_msgMovedByFilter = PR_TRUE; // this will prevent us from adding the header to the db. } + msgIsNew = PR_FALSE; } // note that delete falls through to move. case nsMsgFilterAction::MoveToFolder: @@ -3082,6 +3085,7 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFilterHit(nsIMsgFilter *filter, nsIMsgWindo nsMsgKeyArray keysToFlag; keysToFlag.Add(msgKey); StoreImapFlags(kImapMsgSeenFlag, PR_TRUE, keysToFlag.GetArray(), keysToFlag.GetSize()); + msgIsNew = PR_FALSE; } break; case nsMsgFilterAction::MarkFlagged: @@ -3127,6 +3131,12 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFilterHit(nsIMsgFilter *filter, nsIMsgWindo } } } + if (!msgIsNew) + { + PRInt32 numNewMessages; + GetNumNewMessages(PR_FALSE, &numNewMessages); + SetNumNewMessages(numNewMessages - 1); + } return NS_OK; }