fix mark thread watched/ignored news filter actions r=cavin, sr=sspitzer

This commit is contained in:
bienvenu%netscape.com 2002-11-07 22:16:25 +00:00
Родитель ebc2116e2e
Коммит aacca6bbd0
2 изменённых файлов: 16 добавлений и 5 удалений

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

@ -148,13 +148,17 @@ nsresult nsMsgWatchedThreadsWithUnreadDBView::AddMsgToThreadNotInView(nsIMsgThre
GetFirstMessageHdrToDisplayInThread(threadHdr, getter_AddRefs(parentHdr)); GetFirstMessageHdrToDisplayInThread(threadHdr, getter_AddRefs(parentHdr));
if (parentHdr && (ensureListed || !(msgFlags & MSG_FLAG_READ))) if (parentHdr && (ensureListed || !(msgFlags & MSG_FLAG_READ)))
{ {
PRUint32 orFlags = MSG_VIEW_FLAG_ISTHREAD | MSG_FLAG_ELIDED;
PRUint32 numChildren; PRUint32 numChildren;
threadHdr->GetNumChildren(&numChildren); threadHdr->GetNumChildren(&numChildren);
if (numChildren > 1)
orFlags |= MSG_VIEW_FLAG_HASCHILDREN;
parentHdr->OrFlags(orFlags, &newFlags);
rv = AddHdr(parentHdr); 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; return rv;

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

@ -256,6 +256,13 @@ NS_IMETHODIMP nsMsgThread::AddChild(nsIMsgDBHdr *child, nsIMsgDBHdr *inReplyTo,
hdr->GetFlags(&newHdrFlags); hdr->GetFlags(&newHdrFlags);
hdr->GetMessageKey(&newHdrKey); 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 numChildren;
PRUint32 childIndex = 0; PRUint32 childIndex = 0;
@ -998,7 +1005,7 @@ nsresult nsMsgThread::ChangeUnreadChildCount(PRInt32 delta)
childCount += delta; childCount += delta;
if ((PRInt32) childCount < 0) if ((PRInt32) childCount < 0)
{ {
#ifdef DEBUG_bienvenu #ifdef DEBUG_bienvenu1
NS_ASSERTION(PR_FALSE, "negative unread child count"); NS_ASSERTION(PR_FALSE, "negative unread child count");
#endif #endif
childCount = 0; childCount = 0;