fix(account): update "disabled" semantics

Modified the meaning of "disabled" accounts: they no longer connect to the IMAP server for syncing, but existing data remains accessible for search and queries.
This commit is contained in:
rustmailer
2025-11-24 22:34:40 +08:00
parent e41b26ba0b
commit 089b6885a7
6 changed files with 18 additions and 20 deletions
+8 -8
View File
@@ -112,7 +112,7 @@ impl AccountV1 {
})
}
pub async fn check_account_active(account_id: u64) -> BichonResult<AccountModel> {
pub async fn check_account_exists(account_id: u64) -> BichonResult<AccountModel> {
let account =
secondary_find_impl::<AccountModel>(DB_MANAGER.meta_db(), AccountV1Key::id, account_id)
.await?
@@ -123,12 +123,12 @@ impl AccountV1 {
)
})?;
if !account.enabled {
return Err(raise_error!(
format!("Account id='{account_id}' is disabled"),
ErrorCode::AccountDisabled
));
}
// if !account.enabled {
// return Err(raise_error!(
// format!("Account id='{account_id}' is disabled"),
// ErrorCode::AccountDisabled
// ));
// }
Ok(account)
}
@@ -277,7 +277,7 @@ impl AccountV1 {
let result = list_all_impl(DB_MANAGER.meta_db())
.await?
.into_iter()
.filter(|a: &AccountModel| a.enabled)
//.filter(|a: &AccountModel| a.enabled)
.map(|account: AccountModel| MinimalAccount {
id: account.id,
email: account.email,