mirror of
https://github.com/chatmail/core.git
synced 2026-05-01 20:36:31 +03:00
fix: get_config(Config::Selfavatar) returns the path, not the name (#6570)
Follow-up to #6563
This commit is contained in:
@@ -1435,7 +1435,7 @@ impl Contact {
|
|||||||
pub async fn get_profile_image(&self, context: &Context) -> Result<Option<PathBuf>> {
|
pub async fn get_profile_image(&self, context: &Context) -> Result<Option<PathBuf>> {
|
||||||
if self.id == ContactId::SELF {
|
if self.id == ContactId::SELF {
|
||||||
if let Some(p) = context.get_config(Config::Selfavatar).await? {
|
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) {
|
} else if let Some(image_rel) = self.param.get(Param::ProfileImage) {
|
||||||
if !image_rel.is_empty() {
|
if !image_rel.is_empty() {
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ impl Sql {
|
|||||||
|
|
||||||
if recode_avatar {
|
if recode_avatar {
|
||||||
if let Some(avatar) = context.get_config(Config::Selfavatar).await? {
|
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 {
|
match blob.recode_to_avatar_size(context).await {
|
||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
if let Some(path) = blob.to_abs_path().to_str() {
|
if let Some(path) = blob.to_abs_path().to_str() {
|
||||||
|
|||||||
Reference in New Issue
Block a user