From 664081b790c16ecd0cc9dd9c955aee233f0d66b2 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Tue, 8 Jun 2021 09:06:39 +0300 Subject: [PATCH] Avoid warnings in Contact --- app/src/main/kotlin/com/tutpro/baresip/Contact.kt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/Contact.kt b/app/src/main/kotlin/com/tutpro/baresip/Contact.kt index d333599e..ec9babde 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/Contact.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/Contact.kt @@ -43,18 +43,16 @@ class Contact(var name: String, var uri: String, var color: Int, val id: Long) { val uri = uriParams.substringAfter("<").substringBefore(">") val params = uriParams.substringAfter(">;") val colorValue = Utils.paramValue(params, "color" ) - val color: Int - if (colorValue != "") - color = colorValue.toInt() + val color: Int = if (colorValue != "") + colorValue.toInt() else - color = Utils.randomColor() + Utils.randomColor() val androidContact = Utils.paramValue(params, "android" ) == "true" val idValue = Utils.paramValue(params, "id" ) - val id: Long - if (idValue != "") - id = idValue.toLong() + val id: Long = if (idValue != "") + idValue.toLong() else - id = baseId + contactNo + baseId + contactNo Log.d(TAG, "Restoring contact $name, $uri, $color, $id, $androidContact") val contact = Contact(name, uri, color, id) contact.androidContact = androidContact