Skip to content

Commit 1cabca3

Browse files
authored
fix: get_config(Config::Selfavatar) returns the path, not the name (#6570)
Follow-up to #6563
1 parent 7b3a1b8 commit 1cabca3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/contact.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ impl Contact {
14351435
pub async fn get_profile_image(&self, context: &Context) -> Result<Option<PathBuf>> {
14361436
if self.id == ContactId::SELF {
14371437
if let Some(p) = context.get_config(Config::Selfavatar).await? {
1438-
return Ok(Some(PathBuf::from(p)));
1438+
return Ok(Some(PathBuf::from(p))); // get_config() calls get_abs_path() internally already
14391439
}
14401440
} else if let Some(image_rel) = self.param.get(Param::ProfileImage) {
14411441
if !image_rel.is_empty() {

src/sql.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ impl Sql {
251251

252252
if recode_avatar {
253253
if let Some(avatar) = context.get_config(Config::Selfavatar).await? {
254-
let mut blob = BlobObject::from_name(context, avatar)?;
254+
let mut blob = BlobObject::from_path(context, Path::new(&avatar))?;
255255
match blob.recode_to_avatar_size(context).await {
256256
Ok(()) => {
257257
if let Some(path) = blob.to_abs_path().to_str() {

0 commit comments

Comments
 (0)