Do status flag notifications based on flags changed.

This commit is contained in:
putterman%netscape.com 1999-05-14 21:03:26 +00:00
parent b4451c062e
commit 9febadf761
2 changed files with 16 additions and 1 deletions

View File

@ -152,6 +152,20 @@ nsresult nsMsgDBFolder::ReadDBFolderInfo(PRBool force)
}
nsresult nsMsgDBFolder::SendFlagNotifications(nsISupports *item, PRUint32 oldFlags, PRUint32 newFlags)
{
nsresult rv = NS_OK;
PRUint32 changedFlags = oldFlags ^ newFlags;
if((changedFlags & MSG_FLAG_READ) || (changedFlags & MSG_FLAG_REPLIED)
|| (changedFlags & MSG_FLAG_MARKED) || (changedFlags & MSG_FLAG_FORWARDED)
|| (changedFlags & MSG_FLAG_NEW))
{
rv = NotifyPropertyFlagChanged(item, "Status", oldFlags, newFlags);
}
return rv;
}
NS_IMETHODIMP nsMsgDBFolder::OnKeyChange(nsMsgKey aKeyChanged, PRUint32 aOldFlags, PRUint32 aNewFlags,
nsIDBChangeListener * aInstigator)
{
@ -166,7 +180,7 @@ NS_IMETHODIMP nsMsgDBFolder::OnKeyChange(nsMsgKey aKeyChanged, PRUint32 aOldFlag
nsCOMPtr<nsISupports> msgSupports(do_QueryInterface(message, &rv));
if(NS_SUCCEEDED(rv))
{
NotifyPropertyFlagChanged(msgSupports, "Status", aOldFlags, aNewFlags);
SendFlagNotifications(msgSupports, aOldFlags, aNewFlags);
}
UpdateSummaryTotals();
}

View File

@ -56,6 +56,7 @@ public:
protected:
virtual nsresult ReadDBFolderInfo(PRBool force);
virtual nsresult GetDatabase() = 0;
virtual nsresult SendFlagNotifications(nsISupports *item, PRUint32 oldFlags, PRUint32 newFlags);
protected:
nsCOMPtr<nsIMsgDatabase> mDatabase;