diff --git a/mozilla/mailnews/imap/src/nsImapProtocol.cpp b/mozilla/mailnews/imap/src/nsImapProtocol.cpp index 26e33ec26bc..772260894af 100644 --- a/mozilla/mailnews/imap/src/nsImapProtocol.cpp +++ b/mozilla/mailnews/imap/src/nsImapProtocol.cpp @@ -316,6 +316,7 @@ static PRBool gUseEnvelopeCmd = PR_FALSE; static PRBool gUseLiteralPlus = PR_TRUE; static PRBool gExpungeAfterDelete = PR_FALSE; static PRBool gCheckDeletedBeforeExpunge = PR_FALSE; //bug 235004 +static PRInt32 gExpungeThreshold = 20; static PRInt32 gResponseTimeout = 60; static nsCStringArray gCustomDBHeaders; @@ -342,6 +343,7 @@ nsresult nsImapProtocol::GlobalInitialization() prefBranch->GetBoolPref("mail.imap.use_literal_plus", &gUseLiteralPlus); prefBranch->GetBoolPref("mail.imap.expunge_after_delete", &gExpungeAfterDelete); prefBranch->GetBoolPref("mail.imap.check_deleted_before_expunge", &gCheckDeletedBeforeExpunge); + prefBranch->GetIntPref("mail.imap.expunge_threshold_number", &gExpungeThreshold); prefBranch->GetIntPref("mailnews.tcptimeout", &gResponseTimeout); nsCString customDBHeaders; prefBranch->GetCharPref("mailnews.customDBHeaders", getter_Copies(customDBHeaders)); @@ -3659,9 +3661,8 @@ 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 - if ((m_flagState->GetNumberOfDeletedMessages() >= 20 /* gExpungeThreshold */) && + // Don't do expunge when we are lite selecting folder because we could be doing undo + if ((m_flagState->GetNumberOfDeletedMessages() >= gExpungeThreshold) && !GetShowDeletedMessages() && m_imapAction != nsIImapUrl::nsImapLiteSelectFolder) Expunge(); diff --git a/mozilla/mailnews/mailnews.js b/mozilla/mailnews/mailnews.js index a06e7ac0fe6..2ef0a66b73f 100644 --- a/mozilla/mailnews/mailnews.js +++ b/mozilla/mailnews/mailnews.js @@ -156,6 +156,7 @@ pref("mail.imap.mime_parts_on_demand_threshold", 30000); pref("mail.imap.use_literal_plus", true); pref("mail.imap.expunge_after_delete", false); pref("mail.imap.check_deleted_before_expunge", false); +pref("mail.imap.expunge_threshold_number", 20); // if true, we assume that a user access a folder in the other users namespace // is acting as a delegate for that folder, and wishes to use the other users // identity when acting on messages in other users folders.