fix build bustage in filter code

This commit is contained in:
bienvenu%netscape.com 1999-05-28 00:38:24 +00:00
Родитель f8afbe3ce3
Коммит 14e6523f6e
1 изменённых файлов: 20 добавлений и 16 удалений

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

@ -1570,22 +1570,21 @@ void nsParseNewMailState::ApplyFilters(PRBool *pMoved)
nsresult matchTermStatus = NS_OK; nsresult matchTermStatus = NS_OK;
{ {
#ifdef HAVE_PORT
// how are we going to do this? Probably we need to load // how are we going to do this? Probably we need to load
// the offline mail search service and run the filter, // the offline mail search service and run the filter,
// or perhaps just add an interface on the filter object // or perhaps just add an interface on the filter object
// that does it internally. // that does it internally.
// put this in its own block so scope will get destroyed nsCOMPtr <nsIMsgFolder> inbox;
// before we apply the actions, so folder file will get closed. nsCOMPtr <nsIMsgFolder> rootMsgFolder = do_QueryInterface(m_rootFolder);
nsMsgScopeTerm scope (nsnull, nsMsgSearchScopeMailFolder, m_folder); if (rootMsgFolder)
{
char * headers = m_headers; PRUint32 numFolders;
PRUint32 headersSize = m_headers_fp; rootMsgFolder->GetFoldersWithFlag(MSG_FOLDER_FLAG_INBOX, getter_AddRefs(inbox), 1, &numFolders);
char * headers = m_headers.GetBuffer();
matchTermStatus = msg_SearchOfflineMail::MatchTermsForFilter( PRUint32 headersSize = m_headers.GetBufferPos();
msgHdr, filter->GetTermList(), &scope, m_mailDB, headers, headersSize); matchTermStatus = filter->MatchHdr(msgHdr, inbox, m_mailDB, headers, headersSize);
#endif }
} }
if (NS_SUCCEEDED(matchTermStatus)) if (NS_SUCCEEDED(matchTermStatus))
@ -1743,8 +1742,13 @@ nsresult nsParseNewMailState::MoveIncorporatedMessage(nsIMsgDBHdr *mailHdr,
nsCOMPtr <nsIMsgFolder> lockedFolder; nsCOMPtr <nsIMsgFolder> lockedFolder;
m_rootFolder->FindSubFolder (destFolder, getter_AddRefs(destIFolder)); m_rootFolder->FindSubFolder (destFolder, getter_AddRefs(destIFolder));
lockedFolder = do_QueryInterface(destIFolder); lockedFolder = do_QueryInterface(destIFolder);
nsISupports *myThis;
if (lockedFolder && (err = lockedFolder->AcquireSemaphore (this)) != 0) QueryInterface(::nsISupports::GetIID(), (void **) &myThis);
nsCOMPtr <nsISupports> myISupports = dont_QueryInterface(myThis);
if (lockedFolder && (err = lockedFolder->AcquireSemaphore (myISupports)) != 0)
return err; return err;
NS_ASSERTION(m_inboxFileStream != 0, "no input file stream"); NS_ASSERTION(m_inboxFileStream != 0, "no input file stream");
@ -1754,7 +1758,7 @@ nsresult nsParseNewMailState::MoveIncorporatedMessage(nsIMsgDBHdr *mailHdr,
NS_ASSERTION(PR_FALSE, "couldn't get source file in move filter"); NS_ASSERTION(PR_FALSE, "couldn't get source file in move filter");
#endif #endif
if (lockedFolder) if (lockedFolder)
lockedFolder->ReleaseSemaphore (this); lockedFolder->ReleaseSemaphore (myISupports);
return NS_MSG_FOLDER_UNREADABLE; // ### dmb return NS_MSG_FOLDER_UNREADABLE; // ### dmb
} }
@ -1774,7 +1778,7 @@ nsresult nsParseNewMailState::MoveIncorporatedMessage(nsIMsgDBHdr *mailHdr,
NS_ASSERTION(PR_FALSE, "out of memory"); NS_ASSERTION(PR_FALSE, "out of memory");
#endif #endif
if (lockedFolder) if (lockedFolder)
lockedFolder->ReleaseSemaphore (this); lockedFolder->ReleaseSemaphore (myISupports);
return NS_MSG_ERROR_WRITING_MAIL_FOLDER; return NS_MSG_ERROR_WRITING_MAIL_FOLDER;
} }
@ -1821,7 +1825,7 @@ nsresult nsParseNewMailState::MoveIncorporatedMessage(nsIMsgDBHdr *mailHdr,
// destFile->truncate(destFolder,xpMailFolder,newMsgPos); // destFile->truncate(destFolder,xpMailFolder,newMsgPos);
if (lockedFolder) if (lockedFolder)
lockedFolder->ReleaseSemaphore(this); lockedFolder->ReleaseSemaphore(myISupports);
if (destMailDB) if (destMailDB)
destMailDB->Close(PR_TRUE); destMailDB->Close(PR_TRUE);
@ -1866,7 +1870,7 @@ nsresult nsParseNewMailState::MoveIncorporatedMessage(nsIMsgDBHdr *mailHdr,
// NS_ASSERTION(truncRet >= 0, "unable to truncate file"); // NS_ASSERTION(truncRet >= 0, "unable to truncate file");
if (lockedFolder) if (lockedFolder)
lockedFolder->ReleaseSemaphore (this); lockedFolder->ReleaseSemaphore (myISupports);
// tell parser that we've truncated the Inbox // tell parser that we've truncated the Inbox
mailHdr->GetMessageOffset(&messageOffset); mailHdr->GetMessageOffset(&messageOffset);