From aacca6bbd09c122a3a2aa8dae7d856af89ef011f Mon Sep 17 00:00:00 2001 From: "bienvenu%netscape.com" Date: Thu, 7 Nov 2002 22:16:25 +0000 Subject: [PATCH] fix mark thread watched/ignored news filter actions r=cavin, sr=sspitzer --- mailnews/base/src/nsMsgSpecialViews.cpp | 12 ++++++++---- mailnews/db/msgdb/src/nsMsgThread.cpp | 9 ++++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/mailnews/base/src/nsMsgSpecialViews.cpp b/mailnews/base/src/nsMsgSpecialViews.cpp index 76d2272c85a..2dce69ad31b 100644 --- a/mailnews/base/src/nsMsgSpecialViews.cpp +++ b/mailnews/base/src/nsMsgSpecialViews.cpp @@ -148,13 +148,17 @@ nsresult nsMsgWatchedThreadsWithUnreadDBView::AddMsgToThreadNotInView(nsIMsgThre GetFirstMessageHdrToDisplayInThread(threadHdr, getter_AddRefs(parentHdr)); if (parentHdr && (ensureListed || !(msgFlags & MSG_FLAG_READ))) { - PRUint32 orFlags = MSG_VIEW_FLAG_ISTHREAD | MSG_FLAG_ELIDED; PRUint32 numChildren; threadHdr->GetNumChildren(&numChildren); - if (numChildren > 1) - orFlags |= MSG_VIEW_FLAG_HASCHILDREN; - parentHdr->OrFlags(orFlags, &newFlags); rv = AddHdr(parentHdr); + if (numChildren > 1) + { + nsMsgKey key; + parentHdr->GetMessageKey(&key); + nsMsgViewIndex viewIndex = FindViewIndex(key); + if (viewIndex != nsMsgViewIndex_None) + OrExtraFlag(viewIndex, MSG_FLAG_ELIDED | MSG_VIEW_FLAG_ISTHREAD | MSG_VIEW_FLAG_HASCHILDREN | MSG_FLAG_WATCHED); + } } } return rv; diff --git a/mailnews/db/msgdb/src/nsMsgThread.cpp b/mailnews/db/msgdb/src/nsMsgThread.cpp index 0d742b2bcd2..bf0a5670fb9 100644 --- a/mailnews/db/msgdb/src/nsMsgThread.cpp +++ b/mailnews/db/msgdb/src/nsMsgThread.cpp @@ -256,6 +256,13 @@ NS_IMETHODIMP nsMsgThread::AddChild(nsIMsgDBHdr *child, nsIMsgDBHdr *inReplyTo, hdr->GetFlags(&newHdrFlags); hdr->GetMessageKey(&newHdrKey); + if (newHdrFlags & MSG_FLAG_IGNORED) + SetFlags(m_flags | MSG_FLAG_IGNORED); + + if (newHdrFlags & MSG_FLAG_WATCHED) + SetFlags(m_flags | MSG_FLAG_WATCHED); + + child->AndFlags(~(MSG_FLAG_WATCHED | MSG_FLAG_IGNORED), &newHdrFlags); PRUint32 numChildren; PRUint32 childIndex = 0; @@ -998,7 +1005,7 @@ nsresult nsMsgThread::ChangeUnreadChildCount(PRInt32 delta) childCount += delta; if ((PRInt32) childCount < 0) { -#ifdef DEBUG_bienvenu +#ifdef DEBUG_bienvenu1 NS_ASSERTION(PR_FALSE, "negative unread child count"); #endif childCount = 0;