зеркало из https://github.com/mozilla/pjs.git
fixed bug 26169 -- Sending message appears to fail if the Sent folder not yet parsed; r=scottip
This commit is contained in:
Родитель
1047da0bac
Коммит
5925f968c0
|
@ -289,7 +289,6 @@ interface nsIMsgFolder : nsIFolder {
|
|||
* verbose description of the new messages in this folder
|
||||
*/
|
||||
readonly attribute wstring newMessagesNotificationDescription;
|
||||
readonly attribute nsIMsgDatabase msgDatabase;
|
||||
|
||||
/**
|
||||
* local path of this folder
|
||||
|
@ -299,6 +298,7 @@ interface nsIMsgFolder : nsIFolder {
|
|||
void markMessagesRead(in nsISupportsArray messages, in boolean markRead);
|
||||
void markAllMessagesRead();
|
||||
void markMessagesFlagged(in nsISupportsArray messages, in boolean markFlagged);
|
||||
nsIMsgDatabase getMsgDatabase(in nsIMsgWindow msgWindow);
|
||||
|
||||
nsIMsgFolder getChildWithURI(in string uri, in boolean deep);
|
||||
};
|
||||
|
|
|
@ -496,8 +496,10 @@ nsresult nsMsgDBFolder::CreatePlatformLeafNameForDisk(const char *userLeafName,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgDBFolder::GetMsgDatabase(nsIMsgDatabase** aMsgDatabase)
|
||||
nsMsgDBFolder::GetMsgDatabase(nsIMsgWindow *aMsgWindow,
|
||||
nsIMsgDatabase** aMsgDatabase)
|
||||
{
|
||||
GetDatabase(aMsgWindow);
|
||||
if (!aMsgDatabase || !mDatabase)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
*aMsgDatabase = mDatabase;
|
||||
|
|
|
@ -58,7 +58,8 @@ public:
|
|||
NS_IMETHOD GetFirstNewMessage(nsIMessage **firstNewMessage);
|
||||
NS_IMETHOD ClearNewMessages();
|
||||
|
||||
NS_IMETHOD GetMsgDatabase(nsIMsgDatabase** aMsgDatabase);
|
||||
NS_IMETHOD GetMsgDatabase(nsIMsgWindow *aMsgWindow,
|
||||
nsIMsgDatabase** aMsgDatabase);
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
|
|
|
@ -1813,7 +1813,8 @@ NS_IMETHODIMP nsMsgFolder::GetRootFolder(nsIMsgFolder * *aRootFolder)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgFolder::GetMsgDatabase(nsIMsgDatabase** aMsgDatabase)
|
||||
nsMsgFolder::GetMsgDatabase(nsIMsgWindow *aMsgWindow,
|
||||
nsIMsgDatabase** aMsgDatabase)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
|
|
@ -145,7 +145,8 @@ public:
|
|||
NS_IMETHOD SetNumNewMessages(PRInt32 aNumNewMessages);
|
||||
NS_IMETHOD GetNewMessagesNotificationDescription(PRUnichar * *aNewMessagesNotificationDescription);
|
||||
NS_IMETHOD GetRootFolder(nsIMsgFolder * *aRootFolder);
|
||||
NS_IMETHOD GetMsgDatabase(nsIMsgDatabase * *aMsgDatabase);
|
||||
NS_IMETHOD GetMsgDatabase(nsIMsgWindow *aMsgWindow,
|
||||
nsIMsgDatabase * *aMsgDatabase);
|
||||
NS_IMETHOD GetPath(nsIFileSpec * *aPath);
|
||||
NS_IMETHOD SetPath(nsIFileSpec * aPath);
|
||||
NS_IMETHOD MarkMessagesRead(nsISupportsArray *messages, PRBool markRead);
|
||||
|
|
|
@ -374,13 +374,6 @@ NS_IMETHODIMP nsImapMailFolder::ReplaceElement(nsISupports* element,
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImapMailFolder::GetMsgDatabase(nsIMsgDatabase** aMsgDatabase)
|
||||
{
|
||||
GetDatabase(nsnull);
|
||||
return nsMsgDBFolder::GetMsgDatabase(aMsgDatabase);
|
||||
}
|
||||
|
||||
//Makes sure the database is open and exists. If the database is valid then
|
||||
//returns NS_OK. Otherwise returns a failure error value.
|
||||
nsresult nsImapMailFolder::GetDatabase(nsIMsgWindow *aMsgWindow)
|
||||
|
@ -761,7 +754,7 @@ NS_IMETHODIMP nsImapMailFolder::EmptyTrash()
|
|||
nsCOMPtr<nsIMsgDatabase> trashDB;
|
||||
|
||||
rv = trashFolder->Delete(); // delete summary spec
|
||||
rv = trashFolder->GetMsgDatabase(getter_AddRefs(trashDB));
|
||||
rv = trashFolder->GetMsgDatabase(nsnull, getter_AddRefs(trashDB));
|
||||
|
||||
nsCOMPtr<nsIUrlListener> urlListener =
|
||||
do_QueryInterface(trashFolder);
|
||||
|
@ -2920,7 +2913,7 @@ nsImapMailFolder::OnStopRunningUrl(nsIURI *aUrl, nsresult aExitCode)
|
|||
&rv);
|
||||
nsCOMPtr<nsIMsgDatabase> srcDB;
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = srcFolder->GetMsgDatabase(
|
||||
rv = srcFolder->GetMsgDatabase(aWindow,
|
||||
getter_AddRefs(srcDB));
|
||||
if (NS_SUCCEEDED(rv) && srcDB)
|
||||
{
|
||||
|
|
|
@ -245,8 +245,6 @@ public:
|
|||
// nsIMsgFilterHitNotification method(s)
|
||||
NS_IMETHOD ApplyFilterHit(nsIMsgFilter *filter, PRBool *applyMore);
|
||||
|
||||
// overriding nsMsgDBFolder::GetMsgDatabase()
|
||||
NS_IMETHOD GetMsgDatabase(nsIMsgDatabase** aMsgDatabase);
|
||||
|
||||
nsresult GetMessageHeader(nsMsgKey key, nsIMsgDBHdr ** aMsgHdr);
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ nsImapMoveCopyMsgTxn::Init(
|
|||
m_srcIsPop3 = PR_TRUE;
|
||||
PRUint32 i, count = m_srcKeyArray.GetSize();
|
||||
nsCOMPtr<nsIMsgDatabase> srcDB;
|
||||
rv = m_srcFolder->GetMsgDatabase(getter_AddRefs(srcDB));
|
||||
rv = m_srcFolder->GetMsgDatabase(nsnull, getter_AddRefs(srcDB));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsCOMPtr<nsIMsgDBHdr> srcHdr;
|
||||
|
||||
|
@ -315,9 +315,9 @@ nsImapMoveCopyMsgTxn::UndoMailboxDelete()
|
|||
{
|
||||
nsCOMPtr<nsIMsgDatabase> srcDB;
|
||||
nsCOMPtr<nsIMsgDatabase> dstDB;
|
||||
rv = m_srcFolder->GetMsgDatabase(getter_AddRefs(srcDB));
|
||||
rv = m_srcFolder->GetMsgDatabase(nsnull, getter_AddRefs(srcDB));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = m_dstFolder->GetMsgDatabase(getter_AddRefs(dstDB));
|
||||
rv = m_dstFolder->GetMsgDatabase(nsnull, getter_AddRefs(dstDB));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
PRUint32 count = m_srcKeyArray.GetSize();
|
||||
|
@ -363,7 +363,7 @@ nsImapMoveCopyMsgTxn::RedoMailboxDelete()
|
|||
if (m_srcIsPop3)
|
||||
{
|
||||
nsCOMPtr<nsIMsgDatabase> srcDB;
|
||||
rv = m_srcFolder->GetMsgDatabase(getter_AddRefs(srcDB));
|
||||
rv = m_srcFolder->GetMsgDatabase(nsnull, getter_AddRefs(srcDB));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
srcDB->DeleteMessages(&m_srcKeyArray, nsnull);
|
||||
|
|
|
@ -440,12 +440,6 @@ nsMsgLocalMailFolder::ReplaceElement(nsISupports* element, nsISupports* newEleme
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgLocalMailFolder::GetMsgDatabase(nsIMsgDatabase** aMsgDatabase)
|
||||
{
|
||||
GetDatabase(nsnull);
|
||||
return nsMsgDBFolder::GetMsgDatabase(aMsgDatabase);
|
||||
}
|
||||
|
||||
//Makes sure the database is open and exists. If the database is valid then
|
||||
//returns NS_OK. Otherwise returns a failure error value.
|
||||
|
@ -1278,7 +1272,7 @@ nsMsgLocalMailFolder::CopyMessages(nsIMsgFolder* srcFolder, nsISupportsArray*
|
|||
{
|
||||
nsCOMPtr<nsIMsgDatabase> msgDb;
|
||||
mCopyState->m_parseMsgState = do_QueryInterface(parseMsgState, &rv);
|
||||
rv = GetMsgDatabase(getter_AddRefs(msgDb));
|
||||
rv = GetMsgDatabase(msgWindow, getter_AddRefs(msgDb));
|
||||
if (msgDb)
|
||||
parseMsgState->SetMailDB(msgDb);
|
||||
}
|
||||
|
@ -1362,7 +1356,7 @@ nsMsgLocalMailFolder::CopyFileMessage(nsIFileSpec* fileSpec, nsIMessage*
|
|||
{
|
||||
nsCOMPtr<nsIMsgDatabase> msgDb;
|
||||
mCopyState->m_parseMsgState = do_QueryInterface(parseMsgState, &rv);
|
||||
rv = GetMsgDatabase(getter_AddRefs(msgDb));
|
||||
rv = GetMsgDatabase(msgWindow, getter_AddRefs(msgDb));
|
||||
if (msgDb)
|
||||
parseMsgState->SetMailDB(msgDb);
|
||||
}
|
||||
|
@ -1701,7 +1695,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::EndCopy(PRBool copySucceeded)
|
|||
|
||||
mCopyState->m_parseMsgState->FinishHeader();
|
||||
|
||||
result = GetMsgDatabase(getter_AddRefs(msgDb));
|
||||
result = GetMsgDatabase(nsnull, getter_AddRefs(msgDb));
|
||||
if (NS_SUCCEEDED(result) && msgDb)
|
||||
{
|
||||
if (!mCopyState->m_copyingMultipleMessages)
|
||||
|
@ -1800,7 +1794,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::EndMessage(nsMsgKey key)
|
|||
mCopyState->m_parseMsgState->GetNewMsgHdr(getter_AddRefs(newHdr));
|
||||
if (NS_SUCCEEDED(result) && newHdr)
|
||||
{
|
||||
result = GetMsgDatabase(getter_AddRefs(msgDb));
|
||||
result = GetMsgDatabase(nsnull, getter_AddRefs(msgDb));
|
||||
if (NS_SUCCEEDED(result) && msgDb)
|
||||
{
|
||||
msgDb->AddNewHdrToDB(newHdr, PR_TRUE);
|
||||
|
|
|
@ -135,8 +135,6 @@ public:
|
|||
NS_IMETHOD CreateMessageFromMsgDBHdr(nsIMsgDBHdr *msgDBHdr, nsIMessage **message);
|
||||
NS_IMETHOD GetNewMessages(nsIMsgWindow *aWindow);
|
||||
|
||||
// overriding nsMsgDBFolder::GetMsgDatabase() method
|
||||
NS_IMETHOD GetMsgDatabase(nsIMsgDatabase **aMsgDatabase);
|
||||
|
||||
protected:
|
||||
nsresult ParseFolder(nsIMsgWindow *aMsgWindow, nsFileSpec& path);
|
||||
|
|
|
@ -236,9 +236,9 @@ nsLocalMoveCopyMsgTxn::Undo()
|
|||
nsCOMPtr<nsIMsgDatabase> srcDB;
|
||||
nsCOMPtr<nsIMsgDatabase> dstDB;
|
||||
|
||||
rv = m_srcFolder->GetMsgDatabase(getter_AddRefs(srcDB));
|
||||
rv = m_srcFolder->GetMsgDatabase(nsnull, getter_AddRefs(srcDB));
|
||||
if(NS_FAILED(rv)) return rv;
|
||||
rv = m_dstFolder->GetMsgDatabase(getter_AddRefs(dstDB));
|
||||
rv = m_dstFolder->GetMsgDatabase(nsnull, getter_AddRefs(dstDB));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
PRUint32 count = m_srcKeyArray.GetSize();
|
||||
|
@ -289,9 +289,9 @@ nsLocalMoveCopyMsgTxn::Redo()
|
|||
nsCOMPtr<nsIMsgDatabase> srcDB;
|
||||
nsCOMPtr<nsIMsgDatabase> dstDB;
|
||||
|
||||
rv = m_srcFolder->GetMsgDatabase(getter_AddRefs(srcDB));
|
||||
rv = m_srcFolder->GetMsgDatabase(nsnull, getter_AddRefs(srcDB));
|
||||
if(NS_FAILED(rv)) return rv;
|
||||
rv = m_dstFolder->GetMsgDatabase(getter_AddRefs(dstDB));
|
||||
rv = m_dstFolder->GetMsgDatabase(nsnull, getter_AddRefs(dstDB));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
PRUint32 count = m_srcKeyArray.GetSize();
|
||||
|
|
Загрузка…
Ссылка в новой задаче