mirror of
https://github.com/rustmailer/bichon.git
synced 2026-08-03 07:48:34 +02:00
Refactor: decouple email body and attachment storage
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
use crate::modules::{
|
||||
cache::imap::mailbox::MailBox,
|
||||
error::BichonResult,
|
||||
indexer::manager::{EML_INDEX_MANAGER, ENVELOPE_INDEX_MANAGER},
|
||||
indexer::{
|
||||
attachment::ATTACHMENT_INDEX_MANAGER, eml::EML_INDEX_MANAGER,
|
||||
manager::ENVELOPE_INDEX_MANAGER,
|
||||
},
|
||||
};
|
||||
|
||||
pub async fn delete_mailbox_impl(account_id: u64, mailbox_id: u64) -> BichonResult<()> {
|
||||
@@ -26,13 +29,11 @@ pub async fn delete_mailbox_impl(account_id: u64, mailbox_id: u64) -> BichonResu
|
||||
MailBox::delete(*id).await?;
|
||||
}
|
||||
|
||||
ENVELOPE_INDEX_MANAGER
|
||||
let content_hashes = ENVELOPE_INDEX_MANAGER
|
||||
.delete_mailbox_envelopes(account_id, ids_to_delete.clone())
|
||||
.await?;
|
||||
|
||||
EML_INDEX_MANAGER
|
||||
.delete_mailbox_envelopes(account_id, ids_to_delete)
|
||||
.await?;
|
||||
|
||||
EML_INDEX_MANAGER.delete(&content_hashes).await?;
|
||||
ATTACHMENT_INDEX_MANAGER.delete(&content_hashes).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user