mirror of
https://github.com/chatmail/core.git
synced 2026-05-25 01:36:31 +03:00
use constant for folders_configured cache
This commit is contained in:
@@ -214,6 +214,9 @@ pub const DC_BOB_SUCCESS: i32 = 1;
|
|||||||
// max. width/height of an avatar
|
// max. width/height of an avatar
|
||||||
pub const AVATAR_SIZE: u32 = 192;
|
pub const AVATAR_SIZE: u32 = 192;
|
||||||
|
|
||||||
|
// this value can be increased if the folder configuration is changed and must be redone on next program start
|
||||||
|
pub const DC_FOLDERS_CONFIGURED_VERSION: i32 = 3;
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
Debug,
|
Debug,
|
||||||
Display,
|
Display,
|
||||||
|
|||||||
@@ -1074,9 +1074,7 @@ impl Imap {
|
|||||||
let folders_configured = context
|
let folders_configured = context
|
||||||
.sql
|
.sql
|
||||||
.get_raw_config_int(context, "folders_configured");
|
.get_raw_config_int(context, "folders_configured");
|
||||||
if folders_configured.unwrap_or_default() >= 3 {
|
if folders_configured.unwrap_or_default() >= DC_FOLDERS_CONFIGURED_VERSION {
|
||||||
// the "3" here we increase if we have future updates to
|
|
||||||
// to folder configuration
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1168,9 +1166,11 @@ impl Imap {
|
|||||||
Some(sentbox_folder.name()),
|
Some(sentbox_folder.name()),
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
context
|
context.sql.set_raw_config_int(
|
||||||
.sql
|
context,
|
||||||
.set_raw_config_int(context, "folders_configured", 3)?;
|
"folders_configured",
|
||||||
|
DC_FOLDERS_CONFIGURED_VERSION,
|
||||||
|
)?;
|
||||||
}
|
}
|
||||||
info!(context, "FINISHED configuring IMAP-folders.");
|
info!(context, "FINISHED configuring IMAP-folders.");
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user