зеркало из https://github.com/mozilla/pjs.git
work on MarkFlagged.
This commit is contained in:
Родитель
66524af390
Коммит
c5bc4f5797
|
@ -320,6 +320,14 @@ NS_IMETHODIMP nsMessage::MarkRead(PRBool bRead)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP nsMessage::MarkFlagged(PRBool bFlagged)
|
||||||
|
{
|
||||||
|
if(mMsgHdr)
|
||||||
|
return mMsgHdr->MarkFlagged(bFlagged);
|
||||||
|
else
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsMessage::GetMessageKey(nsMsgKey *result)
|
NS_IMETHODIMP nsMessage::GetMessageKey(nsMsgKey *result)
|
||||||
{
|
{
|
||||||
if(mMsgHdr)
|
if(mMsgHdr)
|
||||||
|
|
|
@ -81,6 +81,7 @@ public:
|
||||||
|
|
||||||
// Mark message routines
|
// Mark message routines
|
||||||
NS_IMETHOD MarkRead(PRBool bRead);
|
NS_IMETHOD MarkRead(PRBool bRead);
|
||||||
|
NS_IMETHOD MarkFlagged(PRBool bFlagged);
|
||||||
|
|
||||||
NS_IMETHOD GetMessageKey(nsMsgKey *result);
|
NS_IMETHOD GetMessageKey(nsMsgKey *result);
|
||||||
NS_IMETHOD GetThreadId(nsMsgKey *result);
|
NS_IMETHOD GetThreadId(nsMsgKey *result);
|
||||||
|
|
|
@ -255,10 +255,13 @@ nsresult nsMsgDBFolder::SendFlagNotifications(nsISupports *item, PRUint32 oldFla
|
||||||
|
|
||||||
PRUint32 changedFlags = oldFlags ^ newFlags;
|
PRUint32 changedFlags = oldFlags ^ newFlags;
|
||||||
if((changedFlags & MSG_FLAG_READ) || (changedFlags & MSG_FLAG_REPLIED)
|
if((changedFlags & MSG_FLAG_READ) || (changedFlags & MSG_FLAG_REPLIED)
|
||||||
|| (changedFlags & MSG_FLAG_MARKED) || (changedFlags & MSG_FLAG_FORWARDED)
|
|| (changedFlags & MSG_FLAG_FORWARDED)|| (changedFlags & MSG_FLAG_NEW))
|
||||||
|| (changedFlags & MSG_FLAG_NEW))
|
|
||||||
{
|
{
|
||||||
rv = NotifyPropertyFlagChanged(item, "Status", oldFlags, newFlags);
|
rv = NotifyPropertyFlagChanged(item, "Status", oldFlags, newFlags);
|
||||||
|
}
|
||||||
|
else if((changedFlags & MSG_FLAG_MARKED))
|
||||||
|
{
|
||||||
|
rv = NotifyPropertyFlagChanged(item, "Flagged", oldFlags, newFlags);
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,6 @@ NS_IMETHODIMP nsMsgFolder::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsMsgFolder::Init(const char* aURI)
|
nsMsgFolder::Init(const char* aURI)
|
||||||
{
|
{
|
||||||
nsresult rv;
|
|
||||||
|
|
||||||
// this parsing is totally hacky. we really should generalize this,
|
// this parsing is totally hacky. we really should generalize this,
|
||||||
// but I'm not going to do this until we can eliminate the
|
// but I'm not going to do this until we can eliminate the
|
||||||
|
@ -903,10 +902,6 @@ NS_IMETHODIMP nsMsgFolder::GetTotalMessages(PRBool deep, PRInt32 *totalMessages)
|
||||||
NS_IMETHOD GetTotalMessagesInDB(PRUint32 *totalMessages) const; // How many messages in database.
|
NS_IMETHOD GetTotalMessagesInDB(PRUint32 *totalMessages) const; // How many messages in database.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_PANE
|
|
||||||
virtual void MarkAllRead(MSG_Pane *pane, PRBool deep);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_DB
|
#ifdef HAVE_DB
|
||||||
// These functions are used for tricking the front end into thinking that we have more
|
// These functions are used for tricking the front end into thinking that we have more
|
||||||
// messages than are really in the DB. This is usually after and IMAP message copy where
|
// messages than are really in the DB. This is usually after and IMAP message copy where
|
||||||
|
@ -1511,6 +1506,31 @@ nsMsgFolder::MarkMessagesRead(nsISupportsArray *messages, PRBool markRead)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsMsgFolder::MarkMessagesFlagged(nsISupportsArray *messages, PRBool markFlagged)
|
||||||
|
{
|
||||||
|
PRUint32 count;
|
||||||
|
nsresult rv;
|
||||||
|
|
||||||
|
rv = messages->Count(&count);
|
||||||
|
if(NS_FAILED(rv))
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
for(PRUint32 i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsISupports> msgSupports = getter_AddRefs(messages->ElementAt(i));
|
||||||
|
nsCOMPtr<nsIMessage> message = do_QueryInterface(msgSupports);
|
||||||
|
|
||||||
|
if(message)
|
||||||
|
rv = message->MarkFlagged(markFlagged);
|
||||||
|
|
||||||
|
if(NS_FAILED(rv))
|
||||||
|
return rv;
|
||||||
|
|
||||||
|
}
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsMsgFolder::MarkAllMessagesRead(void)
|
nsMsgFolder::MarkAllMessagesRead(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -299,6 +299,7 @@ public:
|
||||||
NS_IMETHOD MatchName(nsString *name, PRBool *matches);
|
NS_IMETHOD MatchName(nsString *name, PRBool *matches);
|
||||||
NS_IMETHOD MarkMessagesRead(nsISupportsArray *messages, PRBool markRead);
|
NS_IMETHOD MarkMessagesRead(nsISupportsArray *messages, PRBool markRead);
|
||||||
NS_IMETHOD MarkAllMessagesRead(void);
|
NS_IMETHOD MarkAllMessagesRead(void);
|
||||||
|
NS_IMETHOD MarkMessagesFlagged(nsISupportsArray *messages, PRBool markRead);
|
||||||
|
|
||||||
NS_IMETHOD GetChildWithURI(const char *uri, PRBool deep, nsIMsgFolder ** folder);
|
NS_IMETHOD GetChildWithURI(const char *uri, PRBool deep, nsIMsgFolder ** folder);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче