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) {
val address: String by lazy {
val copy = call.remoteAddress.clone()
copy.clean() // To remove gruu if any
LinphoneUtils.getDisplayableAddress(copy)
LinphoneUtils.getDisplayableAddress(call.remoteAddress)
}
val isPaused = MutableLiveData<Boolean>()

View file

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

View file

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

View file

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