get rid of DOING_FILTERS #define

This commit is contained in:
bienvenu%netscape.com 1999-08-24 04:23:31 +00:00
parent b22eea9c74
commit bfa561f68f
5 changed files with 1 additions and 47 deletions

View File

@ -62,9 +62,8 @@
#include "nsMsgStatusFeedback.h"
#ifdef DOING_FILTERS
#include "nsMsgFilterService.h"
#endif
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
static NS_DEFINE_CID(kCMsgMailSessionCID, NS_MSGMAILSESSION_CID);
@ -277,11 +276,9 @@ nsMsgFactory::CreateInstance(nsISupports * /* aOuter */,
else if (mClassID.Equals(kMsgServerDataSourceCID)) {
rv = NS_NewMsgServerDataSource(aIID, aResult);
}
#ifdef DOING_FILTERS
else if (mClassID.Equals(kMsgFilterServiceCID)) {
rv = NS_NewMsgFilterService(aIID, aResult);
}
#endif
else if (mClassID.Equals(kMsgBiffManagerCID)){
rv = NS_NewMsgBiffManager(aIID, aResult);
}
@ -480,14 +477,11 @@ NSRegisterSelf(nsISupports* aServMgr, const char* path)
path, PR_TRUE, PR_TRUE);
if (NS_FAILED(rv)) finalResult = rv;
#ifdef DOING_FILTERS
printf("register filter service\n");
rv = compMgr->RegisterComponent(kMsgFilterServiceCID,
"Message Filter Service",
NS_MSGFILTERSERVICE_PROGID,
path, PR_TRUE, PR_TRUE);
if (NS_FAILED(rv)) finalResult = rv;
#endif
rv = compMgr->RegisterComponent(kMsgBiffManagerCID,
"Messenger Biff Manager",
@ -564,10 +558,8 @@ NSUnregisterSelf(nsISupports* aServMgr, const char* path)
if (NS_FAILED(rv)) finalResult = rv;
rv = compMgr->UnregisterComponent(kMsgServerDataSourceCID, path);
if (NS_FAILED(rv)) finalResult = rv;
#ifdef DOING_FILTERS
rv = compMgr->UnregisterComponent(kMsgFilterServiceCID, path);
if (NS_FAILED(rv)) finalResult = rv;
#endif
//Biff
rv = compMgr->UnregisterComponent(kMsgBiffManagerCID, path);

View File

@ -103,9 +103,7 @@ nsImapMailFolder::nsImapMailFolder() :
if (NS_SUCCEEDED(rv) && pEventQService)
pEventQService->GetThreadEventQueue(PR_GetCurrentThread(),
getter_AddRefs(m_eventQueue));
#ifdef DOING_FILTERS
m_moveCoalescer = nsnull;
#endif
}
@ -116,10 +114,8 @@ nsImapMailFolder::~nsImapMailFolder()
if (m_appendMsgMonitor)
PR_DestroyMonitor(m_appendMsgMonitor);
#ifdef DOING_FILTERS
if (m_moveCoalescer)
delete m_moveCoalescer;
#endif
}
NS_IMPL_ADDREF_INHERITED(nsImapMailFolder, nsMsgDBFolder)
@ -158,12 +154,10 @@ NS_IMETHODIMP nsImapMailFolder::QueryInterface(REFNSIID aIID, void** aInstancePt
{
*aInstancePtr = NS_STATIC_CAST(nsIUrlListener *, this);
}
#ifdef DOING_FILTERS
else if (aIID.Equals(nsIMsgFilterHitNotify::GetIID()))
{
*aInstancePtr = NS_STATIC_CAST(nsIMsgFilterHitNotify *, this);
}
#endif
if(*aInstancePtr)
{
AddRef();

View File

@ -88,9 +88,7 @@ class nsImapMailFolder : public nsMsgDBFolder,
public nsIImapMiscellaneousSink,
public nsICopyMessageListener,
public nsIUrlListener
#ifdef DOING_FILTERS
,public nsIMsgFilterHitNotify
#endif
{
public:
nsImapMailFolder();

View File

@ -38,11 +38,9 @@
#include "nsIMsgMailNewsUrl.h"
#include "nsLocalStringBundle.h"
#ifdef DOING_FILTERS
#include "nsIMsgFilterService.h"
#include "nsIMsgFilterList.h"
#include "nsIMsgFilter.h"
#endif
static NS_DEFINE_CID(kCMailDB, NS_MAILDB_CID);
static NS_DEFINE_CID(kMsgFilterServiceCID, NS_MSGFILTERSERVICE_CID);
@ -1370,15 +1368,11 @@ int nsParseMailMessageState::FinalizeHeaders()
nsParseNewMailState::nsParseNewMailState()
: m_tmpdbName(nsnull), m_usingTempDB(PR_FALSE), m_disableFilters(PR_FALSE)
{
#ifdef DOING_FILTERS
m_inboxFileStream = nsnull;
m_logFile = nsnull;
#endif
}
#ifdef DOING_FILTERS
NS_IMPL_ISUPPORTS_INHERITED(nsParseNewMailState, nsMsgMailboxParser, nsIMsgFilterHitNotify)
#endif
nsresult
nsParseNewMailState::Init(nsIFolder *rootFolder, nsFileSpec &folder, nsIOFileStream *inboxFileStream)
@ -1387,11 +1381,9 @@ nsParseNewMailState::Init(nsIFolder *rootFolder, nsFileSpec &folder, nsIOFileStr
m_mailboxName = nsCRT::strdup(folder);
m_position = folder.GetFileSize();
#ifdef DOING_FILTERS
m_rootFolder = rootFolder;
m_inboxFileSpec = folder;
m_inboxFileStream = inboxFileStream;
#endif
// the new mail parser isn't going to get the stream input, it seems, so we can't use
// the OnStartRequest mechanism the mailbox parser uses. So, let's open the db right now.
nsCOMPtr<nsIMsgDatabase> mailDB;
@ -1406,7 +1398,6 @@ nsParseNewMailState::Init(nsIFolder *rootFolder, nsFileSpec &folder, nsIOFileStr
if (NS_FAILED(rv))
return rv;
#ifdef DOING_FILTERS
NS_WITH_SERVICE(nsIMsgFilterService, filterService, kMsgFilterServiceCID, &rv);
if (NS_FAILED(rv))
return rv;
@ -1434,7 +1425,6 @@ nsParseNewMailState::Init(nsIFolder *rootFolder, nsFileSpec &folder, nsIOFileStr
}
m_logFile = nsnull;
#endif
#ifdef DOING_MDN
if (m_filterList)
{
@ -1494,13 +1484,11 @@ nsParseNewMailState::Init(nsIFolder *rootFolder, nsFileSpec &folder, nsIOFileStr
nsParseNewMailState::~nsParseNewMailState()
{
#ifdef DOING_FILTERS
if (m_logFile != nsnull)
{
m_logFile->close();
delete m_logFile;
}
#endif
if (m_mailDB)
m_mailDB->Close(PR_TRUE);
// if (m_usingTempDB)
@ -1551,12 +1539,10 @@ PRInt32 nsParseNewMailState::PublishMsgHeader()
if (m_newMsgHdr)
{
FolderTypeSpecificTweakMsgHeader(m_newMsgHdr);
#ifdef DOING_FILTERS
if (!m_disableFilters)
{
ApplyFilters(&moved);
}
#endif // DOING_FILTERS
if (!moved)
{
if (m_mailDB)
@ -1584,7 +1570,6 @@ void nsParseNewMailState::SetUsingTempDB(PRBool usingTempDB, char *tmpDBName)
m_tmpdbName = tmpDBName;
}
#ifdef DOING_FILTERS
nsOutputFileStream * nsParseNewMailState::GetLogFile ()
{
@ -1954,7 +1939,6 @@ nsresult nsParseNewMailState::MoveIncorporatedMessage(nsIMsgDBHdr *mailHdr,
return err;
}
#endif // DOING_FILTERS
#ifdef IMAP_NEW_MAIL_HANDLED

View File

@ -33,14 +33,8 @@
#include "nsCOMPtr.h"
#ifdef DEBUG_bienvenu
//#define DOING_FILTERS
#endif
#ifdef DOING_FILTERS
#include "nsIMsgFilterList.h"
#include "nsIMsgFilterHitNotify.h"
#endif
class nsFileSpec;
class nsByteArray;
@ -217,16 +211,12 @@ private:
};
class nsParseNewMailState : public nsMsgMailboxParser
#ifdef DOING_FILTERS
, public nsIMsgFilterHitNotify
#endif
{
public:
nsParseNewMailState();
virtual ~nsParseNewMailState();
#ifdef DOING_FILTERS
NS_DECL_ISUPPORTS_INHERITED
#endif
nsresult Init(nsIFolder *rootFolder, nsFileSpec &folder, nsIOFileStream *inboxFileStream);
virtual void DoneParsingFolder();
@ -243,17 +233,14 @@ public:
nsIMsgFilter *filter,
PRBool *pMoved);
#endif
#ifdef DOING_FILTERS
// nsIMsgFilterHitNotification method(s)
NS_IMETHOD ApplyFilterHit(nsIMsgFilter *filter, PRBool *applyMore);
nsOutputFileStream *GetLogFile();
#endif // DOING_FILTERS
protected:
virtual PRInt32 PublishMsgHeader();
char *m_tmpdbName; // Temporary filename of new database
PRBool m_usingTempDB;
#ifdef DOING_FILTERS
virtual void ApplyFilters(PRBool *pMoved);
virtual nsresult GetTrashFolder(nsIMsgFolder **pTrashFolder);
virtual nsresult MoveIncorporatedMessage(nsIMsgDBHdr *mailHdr,
@ -267,7 +254,6 @@ protected:
nsOutputFileStream *m_logFile;
nsIOFileStream *m_inboxFileStream;
nsFileSpec m_inboxFileSpec;
#endif // DOING_FILTERS
PRBool m_disableFilters;
PRBool m_msgMovedByFilter;
};