From 1cabca34db8ad8a3ad0af53c9ac3045ef80bc48e Mon Sep 17 00:00:00 2001 From: Hocuri Date: Mon, 24 Feb 2025 16:43:36 +0100 Subject: [PATCH] fix: get_config(Config::Selfavatar) returns the path, not the name (#6570) Follow-up to #6563 --- src/contact.rs | 2 +- src/sql.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/contact.rs b/src/contact.rs index 02e34dcac..a802148d4 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -1435,7 +1435,7 @@ impl Contact { pub async fn get_profile_image(&self, context: &Context) -> Result> { if self.id == ContactId::SELF { if let Some(p) = context.get_config(Config::Selfavatar).await? { - return Ok(Some(PathBuf::from(p))); + return Ok(Some(PathBuf::from(p))); // get_config() calls get_abs_path() internally already } } else if let Some(image_rel) = self.param.get(Param::ProfileImage) { if !image_rel.is_empty() { diff --git a/src/sql.rs b/src/sql.rs index a355e62b0..16b65bcb7 100644 --- a/src/sql.rs +++ b/src/sql.rs @@ -251,7 +251,7 @@ impl Sql { if recode_avatar { if let Some(avatar) = context.get_config(Config::Selfavatar).await? { - let mut blob = BlobObject::from_name(context, avatar)?; + let mut blob = BlobObject::from_path(context, Path::new(&avatar))?; match blob.recode_to_avatar_size(context).await { Ok(()) => { if let Some(path) = blob.to_abs_path().to_str() {