Fixing bug 97650. Adding improvements to unread count mail count display feature on Win XP. When the mail application starts, as soon as the unread count on Inbox folder changes, registry is updated. This enables us to present the user accurate unread count on the welcome screen, if user quits the app before the 5 minute timer is triggered. r=mscott, sr=sspitzer

This commit is contained in:
racham%netscape.com 2001-10-03 05:54:30 +00:00
Родитель 1929e56a99
Коммит 778bf75c30
2 изменённых файлов: 23 добавлений и 1 удалений

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

@ -70,6 +70,7 @@ nsMessengerWinIntegration::nsMessengerWinIntegration()
mDefaultServerAtom = getter_AddRefs(NS_NewAtom("DefaultServer"));
mTotalUnreadMessagesAtom = getter_AddRefs(NS_NewAtom("TotalUnreadMessages"));
mFirstTimeFolderUnreadCountChanged = PR_TRUE;
mInboxURI = nsnull;
mEmail = nsnull;
}
@ -207,7 +208,7 @@ nsMessengerWinIntegration::Init()
rv = ResetCurrent();
NS_ENSURE_SUCCESS(rv,rv);
rv = SetupUnreadCountUpdateTimer();
NS_ENSURE_SUCCESS(rv,rv);
@ -294,6 +295,24 @@ nsMessengerWinIntegration::OnItemIntPropertyChanged(nsISupports *aItem, nsIAtom
rv = folderResource->GetValueConst(&itemURI);
NS_ENSURE_SUCCESS(rv,rv);
// Today, if the user brings up the mail app and gets his/her mail and read
// couple of messages and quit the app before the first timer action is
// triggered, app will not get the opportunity to update the registry
// latest unread count thus displaying essentially the previous sessions's data.
// That is not desirable. So, we can avoid that situation by updating the
// registry first time the total unread count is changed. That will update
// the registry to reflect the first user action that alters unread mail count.
// As the user reads some of the messages, the latest unread mail count
// is kept track of. Now, if the user quits before the first timer is triggered,
// the registry is updated one last time via UpdateRegistryWithCurrent() as we will
// have all information needed available to do so.
if (mFirstTimeFolderUnreadCountChanged) {
mFirstTimeFolderUnreadCountChanged = PR_FALSE;
rv = UpdateUnreadCount();
NS_ENSURE_SUCCESS(rv,rv);
}
if (itemURI && mInboxURI && !nsCRT::strcmp(itemURI, mInboxURI)) {
mCurrentUnreadCount = aNewValue;
}

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

@ -107,6 +107,9 @@ private:
// "might" because we don't know until we check
// what type of server is associated with the default account
PRBool mDefaultAccountMightHaveAnInbox;
// first time the unread count changes, we need to update registry
PRBool mFirstTimeFolderUnreadCountChanged;
};
#endif // __nsMessengerWinIntegration_h