fix: get_config(Config::Selfavatar) returns the path, not the name (#6570)

Follow-up to #6563
This commit is contained in:
Hocuri
2025-02-24 16:43:36 +01:00
committed by GitHub
parent 7b3a1b88e6
commit 1cabca34db
2 changed files with 2 additions and 2 deletions

View File

@@ -1435,7 +1435,7 @@ impl Contact {
pub async fn get_profile_image(&self, context: &Context) -> Result<Option<PathBuf>> {
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() {

View File

@@ -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() {