fix 298737 newsgroups lose track of counts when headers haven't been downloaded, sr=mscott

This commit is contained in:
bienvenu%nventure.com 2006-12-10 21:25:24 +00:00
Родитель dcb8913407
Коммит b235d13206
1 изменённых файлов: 7 добавлений и 9 удалений

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

@ -832,20 +832,16 @@ nsMsgNewsFolder::UpdateSummaryFromNNTPInfo(PRInt32 oldest, PRInt32 youngest, PRI
unread -= deltaInDB;
}
mNumUnreadMessages = unread;
mNumTotalMessages = total;
PRInt32 pendingUnreadDelta = unread - mNumUnreadMessages - mNumPendingUnreadMessages;
PRInt32 pendingTotalDelta = total - mNumTotalMessages - mNumPendingTotalMessages;
ChangeNumPendingUnread(pendingUnreadDelta);
ChangeNumPendingTotalMessages(pendingTotalDelta);
#if 0
m_nntpHighwater = youngest;
m_nntpTotalArticles = total;
#endif
//Need to notify listeners that total count changed.
if(oldTotalMessages != mNumTotalMessages)
NotifyIntPropertyChanged(kTotalMessagesAtom, oldTotalMessages, mNumTotalMessages);
if(oldUnreadMessages != mNumUnreadMessages)
NotifyIntPropertyChanged(kTotalUnreadMessagesAtom, oldUnreadMessages, mNumUnreadMessages);
return rv;
}
@ -989,6 +985,8 @@ nsMsgNewsFolder::DeleteMessages(nsISupportsArray *messages, nsIMsgWindow *aMsgWi
NS_IMETHODIMP nsMsgNewsFolder::GetNewMessages(nsIMsgWindow *aMsgWindow, nsIUrlListener *aListener)
{
ChangeNumPendingTotalMessages(-GetNumPendingTotalMessages());
ChangeNumPendingUnread(-GetNumPendingUnread());
return GetNewsMessages(aMsgWindow, PR_FALSE, aListener);
}