From bcaed1d16ed95a3fafe408b5402bea9d54464683 Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Tue, 23 Sep 2003 18:53:12 +0000 Subject: [PATCH] occasionally expunge folders when user is using delete immediately delete model, r/sr=mscott 156168 --- mailnews/imap/src/nsImapProtocol.cpp | 22 +++++++++++++++------- mailnews/imap/src/nsImapProtocol.h | 1 + 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/mailnews/imap/src/nsImapProtocol.cpp b/mailnews/imap/src/nsImapProtocol.cpp index e1f75cebfef..c31a489ccbb 100644 --- a/mailnews/imap/src/nsImapProtocol.cpp +++ b/mailnews/imap/src/nsImapProtocol.cpp @@ -1602,10 +1602,8 @@ NS_IMETHODIMP nsImapProtocol::CanHandleUrl(nsIImapUrl * aImapUrl, nsCAutoString curSelectedUrlFolderName; nsCAutoString pendingUrlFolderName; if (inSelectedState) - { - curSelectedUrlFolderName = - GetServerStateParser().GetSelectedMailboxName(); - } + curSelectedUrlFolderName = GetServerStateParser().GetSelectedMailboxName(); + if (isBusy) { nsImapState curUrlImapState; @@ -3337,10 +3335,11 @@ void nsImapProtocol::ProcessMailboxUpdate(PRBool handlePossibleUndo) // lets see if we should expunge during a full sync of flags. if (!DeathSignalReceived()) // only expunge if not reading messages manually and before fetching new { - // ### TODO read gExpungeThreshhold from prefs. Don't do expunge when we are lite selecting folder because we could be doing undo + // ### TODO read gExpungeThreshhold from prefs. Don't do expunge when we + // are lite selecting folder because we could be doing undo if ((m_flagState->GetNumberOfDeletedMessages() >= 20/* gExpungeThreshold */) - && GetDeleteIsMoveToTrash() && m_imapAction != nsIImapUrl::nsImapLiteSelectFolder) - Expunge(); // might be expensive, test for user cancel + && !GetShowDeletedMessages() && m_imapAction != nsIImapUrl::nsImapLiteSelectFolder) + Expunge(); } } @@ -7161,6 +7160,15 @@ nsImapProtocol::GetDeleteIsMoveToTrash() return rv; } +PRBool +nsImapProtocol::GetShowDeletedMessages() +{ + PRBool rv = PR_FALSE; + if (m_hostSessionList) + m_hostSessionList->GetShowDeletedMessagesForHost(GetImapServerKey(), rv); + return rv; +} + NS_IMETHODIMP nsImapProtocol::OverrideConnectionInfo(const PRUnichar *pHost, PRUint16 pPort, const char *pCookieData) { m_logonHost.AssignWithConversion(pHost); diff --git a/mailnews/imap/src/nsImapProtocol.h b/mailnews/imap/src/nsImapProtocol.h index df9be11ddd6..c59650a823b 100644 --- a/mailnews/imap/src/nsImapProtocol.h +++ b/mailnews/imap/src/nsImapProtocol.h @@ -431,6 +431,7 @@ private: // End thread support stuff PRBool GetDeleteIsMoveToTrash(); + PRBool GetShowDeletedMessages(); PRMonitor *GetDataMemberMonitor(); nsCString m_currentCommand; nsImapServerResponseParser m_parser;