diff --git a/src/config.rs b/src/config.rs index afa4aa167..d5a165ac3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -8,6 +8,7 @@ use crate::constants::DC_VERSION_STR; use crate::context::Context; use crate::dc_tools::*; use crate::job::*; +use crate::mimefactory::RECOMMENDED_FILE_SIZE; use crate::stock::StockMessage; use rusqlite::NO_PARAMS; @@ -98,7 +99,7 @@ impl Context { rel_path.map(|p| dc_get_abs_path(self, &p).to_string_lossy().into_owned()) } Config::SysVersion => Some((&*DC_VERSION_STR).clone()), - Config::SysMsgsizeMaxRecommended => Some(format!("{}", 24 * 1024 * 1024 / 4 * 3)), + Config::SysMsgsizeMaxRecommended => Some(format!("{}", RECOMMENDED_FILE_SIZE)), Config::SysConfigKeys => Some(get_config_keys_string()), _ => self.sql.get_raw_config(self, key), }; diff --git a/src/mimefactory.rs b/src/mimefactory.rs index bec224e4f..cdf576b8c 100644 --- a/src/mimefactory.rs +++ b/src/mimefactory.rs @@ -21,7 +21,7 @@ use crate::stock::StockMessage; // (brutto examples: web.de=50, 1&1=40, t-online.de=32, gmail=25, posteo=50, yahoo=25, all-inkl=100). // as an upper limit, we double the size; the core won't send messages larger than this // to get the netto sizes, we subtract 1 mb header-overhead and the base64-overhead. -const RECOMMENDED_FILE_SIZE: u64 = 24 * 1024 * 1024 / 4 * 3; +pub const RECOMMENDED_FILE_SIZE: u64 = 24 * 1024 * 1024 / 4 * 3; const UPPER_LIMIT_FILE_SIZE: u64 = 49 * 1024 * 1024 / 4 * 3; #[derive(Debug, Clone)]