From f9a0f8a0333ed857ac9e15dc8a0131bf7f0cdd07 Mon Sep 17 00:00:00 2001 From: "jefft%netscape.com" Date: Fri, 6 Aug 1999 21:03:59 +0000 Subject: [PATCH] remove summary file prior trash all messages --- mailnews/imap/src/nsImapMailFolder.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/mailnews/imap/src/nsImapMailFolder.cpp b/mailnews/imap/src/nsImapMailFolder.cpp index 3312640d567..0994274ef80 100644 --- a/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mailnews/imap/src/nsImapMailFolder.cpp @@ -568,6 +568,29 @@ NS_IMETHODIMP nsImapMailFolder::EmptyTrash() rv = GetTrashFolder(getter_AddRefs(trashFolder)); if (NS_SUCCEEDED(rv)) { + nsCOMPtr trashDB; + rv = trashFolder->GetMsgDatabase(getter_AddRefs(trashDB)); + if (NS_SUCCEEDED(rv)) + { + trashDB->ForceClosed(); + trashDB = null_nsCOMPtr(); + } + nsCOMPtr pathSpec; + rv = trashFolder->GetPath(getter_AddRefs(pathSpec)); + if (NS_SUCCEEDED(rv)) + { + nsFileSpec fileSpec; + rv = pathSpec->GetFileSpec(&fileSpec); + if (NS_SUCCEEDED(rv)) + { + nsLocalFolderSummarySpec summarySpec(fileSpec); + if (summarySpec.Exists()) + summarySpec.Delete(PR_FALSE); + } + } + + rv = trashFolder->GetMsgDatabase(getter_AddRefs(trashDB)); + NS_WITH_SERVICE (nsIImapService, imapService, kCImapService, &rv); if (NS_SUCCEEDED(rv)) rv = imapService->DeleteAllMessages(m_eventQueue, trashFolder,