target detailed checks of @flub

This commit is contained in:
B. Petersen
2019-10-04 22:53:23 +02:00
parent 2317518e5e
commit 9cae075b6f
7 changed files with 29 additions and 42 deletions

View File

@@ -79,12 +79,7 @@ impl Context {
let value = match key {
Config::Selfavatar => {
let rel_path = self.sql.get_raw_config(self, key);
rel_path.map(|p| {
dc_get_abs_path(self, &p)
.to_str()
.unwrap_or_default()
.to_string()
})
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)),
@@ -118,7 +113,7 @@ impl Context {
pub fn set_config(&self, key: Config, value: Option<&str>) -> Result<(), Error> {
match key {
Config::Selfavatar if value.is_some() => {
let rel_path = std::fs::canonicalize(value.unwrap_or_default())?;
let rel_path = std::fs::canonicalize(value.unwrap())?;
self.sql
.set_raw_config(self, key, Some(&rel_path.to_string_lossy()))
}