mirror of
https://github.com/chatmail/core.git
synced 2026-05-06 16:36:59 +03:00
let quota-warning reappear after import, rewarn at 95% (#2702)
* let quota-warning reappear after import an import removes all device-messages, including the quota warning. resetting `Config::QuotaExceeding` makes sure, the warning reappears soon after import - otherwise the warning would reappear only after storage is cleaned up and exceeds again. * a second quota warning when 95% storage exceeded * factor out warning-check and add a test for that
This commit is contained in:
@@ -2940,6 +2940,8 @@ pub async fn was_device_msg_ever_added(context: &Context, label: &str) -> Result
|
||||
// no wrong information are shown in the device chat
|
||||
// - deletion in `devmsglabels` makes sure,
|
||||
// deleted messages are resetted and useful messages can be added again
|
||||
// - we reset the config-option `QuotaExceeding`
|
||||
// that is used as a helper to drive the corresponding device message.
|
||||
pub(crate) async fn delete_and_reset_all_device_msgs(context: &Context) -> Result<()> {
|
||||
context
|
||||
.sql
|
||||
@@ -2952,6 +2954,7 @@ pub(crate) async fn delete_and_reset_all_device_msgs(context: &Context) -> Resul
|
||||
.sql
|
||||
.execute("DELETE FROM devmsglabels;", paramsv![])
|
||||
.await?;
|
||||
context.set_config(Config::QuotaExceeding, None).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user