mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 17:55:50 +00:00
Do status flag notifications based on flags changed.
This commit is contained in:
parent
b4451c062e
commit
9febadf761
@ -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();
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user