From 6e3cec28fc2d6906e477297b763adc0c74c0eb53 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Thu, 5 Apr 2001 07:13:16 +0000 Subject: [PATCH] fix for #74808. when setting a "new" message as "read", it should properly update in the message pane. sr=bienvenu git-svn-id: svn://10.0.0.236/trunk@91436 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/base/src/nsMsgDBView.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mozilla/mailnews/base/src/nsMsgDBView.cpp b/mozilla/mailnews/base/src/nsMsgDBView.cpp index b264bb9135b..cc1aa9e3b89 100644 --- a/mozilla/mailnews/base/src/nsMsgDBView.cpp +++ b/mozilla/mailnews/base/src/nsMsgDBView.cpp @@ -1600,10 +1600,20 @@ nsresult nsMsgDBView::SetReadByIndex(nsMsgViewIndex index, PRBool read) if (!IsValidIndex(index)) return NS_MSG_INVALID_DBVIEW_INDEX; - if (read) + if (read) { OrExtraFlag(index, MSG_FLAG_READ); - else + // MarkRead() will clear this flag in the db + // and then call OnKeyChange(), but + // because we are the instigator of the change + // we'll ignore the change. + // + // so we need to clear it in m_flags + // to keep the db and m_flags in sync + AndExtraFlag(index, ~MSG_FLAG_NEW); + } + else { AndExtraFlag(index, ~MSG_FLAG_READ); + } nsCOMPtr dbToUse; rv = GetDBForViewIndex(index, getter_AddRefs(dbToUse));