Fixed address being displayed with gruu when using 'bis' button on diaer & in contact editor

This commit is contained in:
Sylvain Berfini 2021-06-15 16:19:44 +02:00
parent 61d2fdbe10
commit 3aafed8677
4 changed files with 6 additions and 8 deletions

View file

@ -49,9 +49,7 @@ class CallViewModelFactory(private val call: Call) :
open class CallViewModel(val call: Call) : GenericContactViewModel(call.remoteAddress) { open class CallViewModel(val call: Call) : GenericContactViewModel(call.remoteAddress) {
val address: String by lazy { val address: String by lazy {
val copy = call.remoteAddress.clone() LinphoneUtils.getDisplayableAddress(call.remoteAddress)
copy.clean() // To remove gruu if any
LinphoneUtils.getDisplayableAddress(copy)
} }
val isPaused = MutableLiveData<Boolean>() val isPaused = MutableLiveData<Boolean>()

View file

@ -77,7 +77,7 @@ class DetailCallLogFragment : GenericFragment<HistoryDetailFragmentBinding>() {
val copy = viewModel.callLog.remoteAddress.clone() val copy = viewModel.callLog.remoteAddress.clone()
copy.clean() copy.clean()
Log.i("[History] Creating contact with SIP URI: ${copy.asStringUriOnly()}") Log.i("[History] Creating contact with SIP URI: ${copy.asStringUriOnly()}")
navigateToContacts(viewModel.callLog.remoteAddress.asStringUriOnly()) navigateToContacts(copy.asStringUriOnly())
} }
binding.setContactClickListener { binding.setContactClickListener {

View file

@ -45,9 +45,7 @@ class CallLogViewModelFactory(private val callLog: CallLog) :
class CallLogViewModel(val callLog: CallLog) : GenericContactViewModel(callLog.remoteAddress) { class CallLogViewModel(val callLog: CallLog) : GenericContactViewModel(callLog.remoteAddress) {
val peerSipUri: String by lazy { val peerSipUri: String by lazy {
val copy = callLog.remoteAddress.clone() LinphoneUtils.getDisplayableAddress(callLog.remoteAddress)
copy.clean() // To remove gruu if any
LinphoneUtils.getDisplayableAddress(copy)
} }
val statusIconResource: Int by lazy { val statusIconResource: Int by lazy {

View file

@ -49,7 +49,9 @@ class LinphoneUtils {
return if (corePreferences.replaceSipUriByUsername) { return if (corePreferences.replaceSipUriByUsername) {
address.username ?: address.asStringUriOnly() address.username ?: address.asStringUriOnly()
} else { } else {
address.asStringUriOnly() val copy = address.clone()
copy.clean() // To remove gruu if any
copy.asStringUriOnly()
} }
} }