diff --git a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp index 3bdf8c8ecfb..b7c919cf0a4 100644 --- a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp @@ -1128,6 +1128,24 @@ nsImapMailFolder::MarkAllMessagesRead(void) return rv; } +NS_IMETHODIMP nsImapMailFolder::MarkThreadRead(nsIMsgThread *thread) +{ + + nsresult rv = GetDatabase(nsnull); + if(NS_SUCCEEDED(rv)) + { + nsMsgKeyArray thoseMarked; + rv = mDatabase->MarkThreadRead(thread, nsnull, &thoseMarked); + if (NS_SUCCEEDED(rv)) + { + rv = StoreImapFlags(kImapMsgSeenFlag, PR_TRUE, thoseMarked); + mDatabase->Commit(nsMsgDBCommitType::kLargeCommit); + } + } + return rv; +} + + NS_IMETHODIMP nsImapMailFolder::ReadFromFolderCacheElem(nsIMsgFolderCacheElement *element) { nsresult rv = nsMsgDBFolder::ReadFromFolderCacheElem(element); @@ -1901,7 +1919,7 @@ NS_IMETHODIMP nsImapMailFolder::NormalEndHeaderParseStream(nsIImapProtocol* } } // here we need to tweak flags from uid state.. - if (!m_msgMovedByFilter || !DeleteIsMoveToTrash()) + if (!m_msgMovedByFilter || ShowDeletedMessages()) mDatabase->AddNewHdrToDB(newMsgHdr, PR_TRUE); // I don't think we want to do this - it does bad things like set the size incorrectly. // m_msgParser->FinishHeader(); @@ -2166,6 +2184,7 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFilterHit(nsIMsgFilter *filter, PRBool *app keysToFlag.Add(msgKey); StoreImapFlags(kImapMsgSeenFlag | kImapMsgDeletedFlag, PR_TRUE, keysToFlag); + m_msgMovedByFilter = PR_TRUE; // if (!showDeletedMessages) // msgMoved = PR_TRUE; // this will prevent us from adding the header to the db. diff --git a/mozilla/mailnews/imap/src/nsImapMailFolder.h b/mozilla/mailnews/imap/src/nsImapMailFolder.h index 6bac64b7f5f..984cbf10055 100644 --- a/mozilla/mailnews/imap/src/nsImapMailFolder.h +++ b/mozilla/mailnews/imap/src/nsImapMailFolder.h @@ -148,6 +148,7 @@ public: NS_IMETHOD MarkMessagesRead(nsISupportsArray *messages, PRBool markRead); NS_IMETHOD MarkAllMessagesRead(void); NS_IMETHOD MarkMessagesFlagged(nsISupportsArray *messages, PRBool markFlagged); + NS_IMETHOD MarkThreadRead(nsIMsgThread *thread); NS_IMETHOD DeleteSubFolders(nsISupportsArray *folders, nsIMsgWindow *msgWindow); NS_IMETHOD ReadFromFolderCacheElem(nsIMsgFolderCacheElement *element);