fix #74354. the icon in the thread column should have the green arrow

if the thread has any unread messages

fix #72281.  if new message arrive and they are children of a collapsed
thread, they should not become the king of the thread.

sr=bienvenu
This commit is contained in:
sspitzer%netscape.com 2001-04-02 07:22:27 +00:00
Родитель 3c44960b59
Коммит 873cb1f58a
6 изменённых файлов: 33 добавлений и 40 удалений

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

@ -58,6 +58,7 @@ nsIAtom * nsMsgDBView::kFlaggedMsgAtom = nsnull;
nsIAtom * nsMsgDBView::kNewsMsgAtom = nsnull;
nsIAtom * nsMsgDBView::kImapDeletedMsgAtom = nsnull;
nsIAtom * nsMsgDBView::kAttachMsgAtom = nsnull;
nsIAtom * nsMsgDBView::kHasUnreadAtom = nsnull;
PRUnichar * nsMsgDBView::kHighestPriorityString = nsnull;
PRUnichar * nsMsgDBView::kHighPriorityString = nsnull;
@ -110,6 +111,7 @@ void nsMsgDBView::InitializeAtomsAndLiterals()
kNewsMsgAtom = NS_NewAtom("news");
kImapDeletedMsgAtom = NS_NewAtom("imapdeleted");
kAttachMsgAtom = NS_NewAtom("attach");
kHasUnreadAtom = NS_NewAtom("hasUnread");
kHighestPriorityAtom = NS_NewAtom("priority-highest");
kHighPriorityAtom = NS_NewAtom("priority-high");
@ -143,6 +145,7 @@ nsMsgDBView::~nsMsgDBView()
NS_IF_RELEASE(kNewsMsgAtom);
NS_IF_RELEASE(kImapDeletedMsgAtom);
NS_IF_RELEASE(kAttachMsgAtom);
NS_IF_RELEASE(kHasUnreadAtom);
NS_IF_RELEASE(kHighestPriorityAtom);
NS_IF_RELEASE(kHighPriorityAtom);
@ -746,7 +749,25 @@ NS_IMETHODIMP nsMsgDBView::GetCellProperties(PRInt32 aRow, const PRUnichar *colI
properties->AppendElement(kFlaggedMsgAtom);
}
}
if (m_viewFlags & nsMsgViewFlagsType::kThreadedDisplay)
{
if (m_flags[aRow] & MSG_VIEW_FLAG_ISTHREAD)
{
nsCOMPtr <nsIMsgThread> thread;
rv = GetThreadContainingIndex(aRow, getter_AddRefs(thread));
if (NS_SUCCEEDED(rv) && thread)
{
PRUint32 numUnreadChildren;
thread->GetNumUnreadChildren(&numUnreadChildren);
if (numUnreadChildren > 0)
{
properties->AppendElement(kHasUnreadAtom);
}
}
}
}
return NS_OK;
}
@ -3101,30 +3122,6 @@ nsresult nsMsgDBView::AddHdr(nsIMsgDBHdr *msgHdr)
return NS_OK;
}
nsresult nsMsgDBView::InsertHdrAt(nsIMsgDBHdr *msgHdr, nsMsgViewIndex insertIndex)
{
PRUint32 flags = 0;
nsMsgKey msgKey;
msgHdr->GetFlags(&flags);
msgHdr->GetMessageKey(&msgKey);
NoteStartChange(insertIndex, 1, nsMsgViewNotificationCode::changed);
m_keys.SetAt(insertIndex, msgKey);
m_flags.SetAt(insertIndex, flags);
PRInt32 level = 0;
#if 0
if (m_viewFlags & nsMsgViewFlagsType::kThreadedDisplay)
{
level = FindLevelInThread(msgHdr, insertIndex);
}
#endif
m_levels.SetAt(insertIndex, level);
NoteEndChange(insertIndex, 1, nsMsgViewNotificationCode::changed);
OnHeaderAddedOrDeleted();
return NS_OK;
}
PRBool nsMsgDBView::WantsThisThread(nsIMsgThread * /*threadHdr*/)
{
return PR_TRUE; // default is to want all threads.

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

@ -81,6 +81,7 @@ protected:
static nsIAtom* kNewsMsgAtom;
static nsIAtom* kImapDeletedMsgAtom;
static nsIAtom* kAttachMsgAtom;
static nsIAtom* kHasUnreadAtom;
static nsIAtom* kHighestPriorityAtom;
static nsIAtom* kHighPriorityAtom;
@ -145,8 +146,6 @@ protected:
virtual nsresult GetThreadContainingIndex(nsMsgViewIndex index, nsIMsgThread **thread);
virtual nsresult GetMsgHdrForViewIndex(nsMsgViewIndex index, nsIMsgDBHdr **msgHdr);
virtual nsresult InsertHdrAt(nsIMsgDBHdr *msgHdr, nsMsgViewIndex insertIndex);
nsresult ToggleExpansion(nsMsgViewIndex index, PRUint32 *numChanged);
nsresult ExpandByIndex(nsMsgViewIndex index, PRUint32 *pNumExpanded);
nsresult CollapseByIndex(nsMsgViewIndex index, PRUint32 *pNumCollapsed);

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

@ -438,8 +438,9 @@ nsresult nsMsgThreadedDBView::OnNewHeader(nsMsgKey newKey, nsMsgKey aParentKey,
PRUint32 flags = m_flags[threadIndex];
// if we have a collapsed thread which just got a new
// top of thread, change the keys array.
char level = 0; // ### TODO
if ((flags & MSG_FLAG_ELIDED) && level == 0
nsMsgViewIndex insertIndex = GetInsertIndex(msgHdr);
PRInt32 level = FindLevelInThread(msgHdr, insertIndex);
if ((flags & MSG_FLAG_ELIDED) && (level == 0)
&& (!(m_viewFlags & nsMsgViewFlagsType::kUnreadOnly) || !(msgFlags & MSG_FLAG_READ)))
{
nsMsgKey msgKey;
@ -457,12 +458,8 @@ nsresult nsMsgThreadedDBView::OnNewHeader(nsMsgKey newKey, nsMsgKey aParentKey,
}
if (! (flags & MSG_FLAG_ELIDED)) // thread is expanded
{ // insert child into thread
PRUint8 level = 0; // levels of other hdrs may have changed!
// levels of other hdrs may have changed!
PRUint32 newFlags = msgFlags;
nsMsgViewIndex insertIndex = 0;
#if 0
insertIndex = GetInsertInfoForNewHdr(newKey, threadIndex, &level);
#endif
// this header is the new king! try collapsing the existing thread,
// removing it, installing this header as king, and expanding it.
if (level == 0)

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

@ -99,11 +99,11 @@ outlinerbody:-moz-outliner-image(threadCol, container, open) {
list-style-image: url("chrome://messenger/skin/thread-open.gif");
}
outlinerbody:-moz-outliner-image(threadCol, container, unread) {
outlinerbody:-moz-outliner-image(threadCol, container, hasUnread) {
list-style-image: url("chrome://messenger/skin/thread-new-closed.gif");
}
outlinerbody:-moz-outliner-image(threadCol, container, unread, open) {
outlinerbody:-moz-outliner-image(threadCol, container, hasUnread, open) {
list-style-image: url("chrome://messenger/skin/thread-new-open.gif");
}

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

@ -99,11 +99,11 @@ outlinerbody:-moz-outliner-image(threadCol, container, open) {
list-style-image: url("chrome://messenger/skin/thread-open.gif");
}
outlinerbody:-moz-outliner-image(threadCol, container, unread) {
outlinerbody:-moz-outliner-image(threadCol, container, hasUnread) {
list-style-image: url("chrome://messenger/skin/thread-new-closed.gif");
}
outlinerbody:-moz-outliner-image(threadCol, container, unread, open) {
outlinerbody:-moz-outliner-image(threadCol, container, hasUnread, open) {
list-style-image: url("chrome://messenger/skin/thread-new-open.gif");
}

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

@ -99,11 +99,11 @@ outlinerbody:-moz-outliner-image(threadCol, container, open) {
list-style-image: url("chrome://messenger/skin/icons/thread-open.gif");
}
outlinerbody:-moz-outliner-image(threadCol, container, unread) {
outlinerbody:-moz-outliner-image(threadCol, container, hasUnread) {
list-style-image: url("chrome://messenger/skin/icons/thread-new-closed.gif");
}
outlinerbody:-moz-outliner-image(threadCol, container, unread, open) {
outlinerbody:-moz-outliner-image(threadCol, container, hasUnread, open) {
list-style-image: url("chrome://messenger/skin/icons/thread-new-open.gif");
}