fix for #74354. on a new header, force the row for the parent thread to update.

sr=bienvenu
This commit is contained in:
sspitzer%netscape.com 2001-04-02 07:48:53 +00:00
Родитель 7f9f62f103
Коммит 1f21bcf863
1 изменённых файлов: 10 добавлений и 7 удалений

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

@ -440,23 +440,26 @@ nsresult nsMsgThreadedDBView::OnNewHeader(nsMsgKey newKey, nsMsgKey aParentKey,
// top of thread, change the keys array. // top of thread, change the keys array.
nsMsgViewIndex insertIndex = GetInsertIndex(msgHdr); nsMsgViewIndex insertIndex = GetInsertIndex(msgHdr);
PRInt32 level = FindLevelInThread(msgHdr, insertIndex); PRInt32 level = FindLevelInThread(msgHdr, insertIndex);
if ((flags & MSG_FLAG_ELIDED) && (level == 0) if ((flags & MSG_FLAG_ELIDED)
&& (!(m_viewFlags & nsMsgViewFlagsType::kUnreadOnly) || !(msgFlags & MSG_FLAG_READ))) && (!(m_viewFlags & nsMsgViewFlagsType::kUnreadOnly) || !(msgFlags & MSG_FLAG_READ)))
{ {
nsMsgKey msgKey; if (level == 0) {
msgHdr->GetMessageKey(&msgKey); nsMsgKey msgKey;
m_keys.SetAt(threadIndex, msgKey); msgHdr->GetMessageKey(&msgKey);
m_keys.SetAt(threadIndex, msgKey);
}
// note change, to update the parent thread's unread and total counts
NoteChange(threadIndex, 1, nsMsgViewNotificationCode::changed); NoteChange(threadIndex, 1, nsMsgViewNotificationCode::changed);
} }
if (! (flags & MSG_VIEW_FLAG_HASCHILDREN)) if (!(flags & MSG_VIEW_FLAG_HASCHILDREN))
{ {
flags |= MSG_VIEW_FLAG_HASCHILDREN | MSG_VIEW_FLAG_ISTHREAD; flags |= MSG_VIEW_FLAG_HASCHILDREN | MSG_VIEW_FLAG_ISTHREAD;
if (!(m_viewFlags & nsMsgViewFlagsType::kUnreadOnly)) if (!(m_viewFlags & nsMsgViewFlagsType::kUnreadOnly))
flags |= MSG_FLAG_ELIDED; flags |= MSG_FLAG_ELIDED;
m_flags[threadIndex] = flags; m_flags[threadIndex] = flags;
NoteChange(threadIndex, 1, nsMsgViewNotificationCode::changed); NoteChange(threadIndex, 1, nsMsgViewNotificationCode::changed);
} }
if (! (flags & MSG_FLAG_ELIDED)) // thread is expanded if (!(flags & MSG_FLAG_ELIDED)) // thread is expanded
{ // insert child into thread { // insert child into thread
// levels of other hdrs may have changed! // levels of other hdrs may have changed!
PRUint32 newFlags = msgFlags; PRUint32 newFlags = msgFlags;