Fixed adding/editing CardDAV synchronized contact picture

This commit is contained in:
Sylvain Berfini 2025-10-21 16:46:07 +02:00
parent a93f2f2d48
commit 7c8a8dc091

View file

@ -129,8 +129,9 @@ class ContactNewOrEditViewModel
@AnyThread
fun getPictureFileName(): String {
val name = id.value?.replace(" ", "_") ?: "${firstName.value.orEmpty().trim()}_${lastName.value.orEmpty().trim()}"
return "$name.jpg"
val name = id.value ?: "${firstName.value.orEmpty().trim()}_${lastName.value.orEmpty().trim()}"
val flattenedName = name.replace(" ", "_").replace(":", "")
return "$flattenedName.jpg"
}
@UiThread