|
沙发
楼主 |
发表于 2016-3-27 22:19:35
|
只看该作者
- line 1896 -- rv = bundle->GetStringFromName(NS_LITERAL_STRING("autoCompactAllFolders").get(), getter_Copies(confirmString));
- int32_t totalExpungedBytes = 0; //总删除的邮件大小
- int32_t offlineExpungedBytes = 0;
- int32_t localExpungedBytes = 0;
- totalExpungedBytes = localExpungedBytes + offlineExpungedBytes;
- gFolderTreeController.compactFolders();
- folders.compact(null, msgWindow);
- as member of class nsImapMailFolder -- NS_IMETHODIMP nsImapMailFolder::Compact(nsIUrlListener *aListener, nsIMsgWindow *aMsgWindow)
- return imapService->Expunge(this, aListener, aMsgWindow, nullptr);
- NS_IMETHODIMP nsImapService::Expunge(nsIMsgFolder *aImapMailFolder,....)
- {
- FolderCommand(aImapMailFolder, aUrlListener, "/Expunge>", nsIImapUrl::nsImapExpungeFolder, aMsgWindow, aURL);
- }
- nsImapService::FolderCommand(nsIMsgFolder *imapMailFolder,..){rv = GetImapConnectionAndLoadUrl(imapUrl, nullptr, url);}
- EXPUNGE命令在不关闭邮箱的情况下删除所有的标志为DELETED的邮件。EXPUNGE删除的邮件将不可以恢复。
- 例如: C: A202 EXPUNGE
- S: * 3 EXPUNGE
- S: * 3 EXPUNGE
- S: * 5 EXPUNGE
- S: * 8 EXPUNGE
- S: A202 OK EXPUNGE completed
- -----------右键菜单上的压缩也对应执行服务端标志为删除,但还占用存储空间的邮件?
复制代码- 自动压缩单独线程中
- nsMsgDBFolder::AutoCompact(nsIMsgWindow *aWindow){
- nsCOMPtr<nsIRunnable> event = new AutoCompactEvent(aWindow, this);
- if (event)
- NS_DispatchToCurrentThread(event);
- }
- class AutoCompactEvent : public nsRunnable
- {
- NS_IMETHOD Run()
- {
- if (mFolder)
- mFolder->HandleAutoCompactEvent(mMsgWindow);
- return NS_OK;
- }
- }
- nsresult nsMsgDBFolder::HandleAutoCompactEvent(nsIMsgWindow *aWindow)
- {
- if (okToCompact) { nsCOMPtr <nsIAtom> aboutToCompactAtom = MsgGetAtom("AboutToCompact");
- NotifyFolderEvent(aboutToCompactAtom);
- }
- folderCompactor->CompactFolders(folderArray, offlineFolderArray, nullptr, aWindow);
- CompactAllOfflineStores(nullptr, aWindow, offlineFolderArray);
- }
- nsFolderCompactState::CompactFolders(nsIArray *aArrayOfFoldersToCompact,...{
- Compact(firstFolder, m_compactingOfflineFolders, aUrlListener,
- m_folder->AcquireSemaphore(supports);return StartCompacting();
- }
- nsFolderCompactState::StartCompacting()
- {
- rv = m_messageService->CopyMessages(m_size, m_keyArray->m_keys.Elements(),
- }
- 从指定位置 复制邮件
复制代码 |
|