Improved contectName function

This commit is contained in:
Juha Heinanen
2023-03-04 03:37:00 +02:00
parent cf02daad0d
commit ea7b443bb4
@@ -34,11 +34,12 @@ sealed class Contact {
// Return contact name of uri or uri itself if contact with uri is not found // Return contact name of uri or uri itself if contact with uri is not found
fun contactName(uri: String): String { fun contactName(uri: String): String {
var contact = findContact(uri)
if (contact == null) {
val userPart = Utils.uriUserPart(uri) val userPart = Utils.uriUserPart(uri)
val contact = if (Utils.isTelNumber(userPart)) if (Utils.isTelNumber(userPart))
findContact("tel:$userPart") contact = findContact("tel:$userPart")
else }
findContact(uri)
if (contact != null) { if (contact != null) {
return when (contact) { return when (contact) {
is BaresipContact -> is BaresipContact ->