Show contact name and SIP URI in call URI field if label has not been given

This commit is contained in:
Juha Heinanen
2026-08-18 12:44:36 +03:00
parent 925f0340d0
commit 06f6705450

View File

@ -69,8 +69,9 @@ sealed class Contact {
val name = contactWithUri.first.name()
if (includeLabel) {
val label = contactWithUri.second.label
if (label.isNotEmpty()) return "$name $label"
if (unique && contactWithUri.first.uris().size > 1)
if (label.isNotEmpty() && !listOf("SIP", "TEL").contains(label.uppercase()))
return "$name $label"
if (unique || contactWithUri.first.uris().size > 1)
return "$name ${uri.substringAfter(":")}"
return name
}
@ -83,8 +84,9 @@ sealed class Contact {
val name = telContactWithUri.first.name()
if (includeLabel) {
val label = telContactWithUri.second.label
if (label.isNotEmpty()) return "$name $label"
if (unique && telContactWithUri.first.uris().size > 1)
if (label.isNotEmpty() && !listOf("SIP", "TEL").contains(label.uppercase()))
return "$name $label"
if (unique || telContactWithUri.first.uris().size > 1)
return "$name $userPart"
return name
}