Fixed adding/editing CardDAV synchronized contact picture

This commit is contained in:
Sylvain Berfini 2025-10-21 16:46:07 +02:00
parent b0283043ee
commit ab6911dd11

View file

@ -135,8 +135,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