diff --git a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt index c56027954..ea657bc3f 100644 --- a/app/src/main/java/org/linphone/notifications/NotificationsManager.kt +++ b/app/src/main/java/org/linphone/notifications/NotificationsManager.kt @@ -536,7 +536,7 @@ class NotificationsManager @MainThread constructor(private val context: Context) .format(missedCallCount.toString()) Log.i("$TAG Updating missed calls notification count to $missedCallCount") } else { - val remoteAddress = call.remoteAddress + val remoteAddress = call.callLog.remoteAddress val friend: Friend? = coreContext.contactsManager.findContactByAddress(remoteAddress) body = context.getString(R.string.notification_missed_call) .format(friend?.name ?: LinphoneUtils.getDisplayName(remoteAddress)) @@ -910,7 +910,7 @@ class NotificationsManager @MainThread constructor(private val context: Context) val declineIntent = getCallDeclinePendingIntent(notifiable) val answerIntent = getCallAnswerPendingIntent(notifiable) - val remoteAddress = call.remoteAddress + val remoteAddress = call.callLog.remoteAddress val remoteContactAddress = call.remoteContactAddress val conferenceInfo = if (remoteContactAddress != null) { call.core.findConferenceInformationFromUri(remoteContactAddress) ?: call.callLog.conferenceInfo diff --git a/app/src/main/java/org/linphone/telecom/TelecomManager.kt b/app/src/main/java/org/linphone/telecom/TelecomManager.kt index 59795b76f..6fc0e87d9 100644 --- a/app/src/main/java/org/linphone/telecom/TelecomManager.kt +++ b/app/src/main/java/org/linphone/telecom/TelecomManager.kt @@ -81,7 +81,7 @@ class TelecomManager @WorkerThread constructor(context: Context) { fun onCallCreated(call: Call) { Log.i("$TAG Call created: $call") - val address = call.remoteAddress + val address = call.callLog.remoteAddress val friend = coreContext.contactsManager.findContactByAddress(address) val displayName = friend?.name ?: LinphoneUtils.getDisplayName(address) diff --git a/app/src/main/java/org/linphone/ui/call/model/CallModel.kt b/app/src/main/java/org/linphone/ui/call/model/CallModel.kt index b669afda7..ecd03c6b7 100644 --- a/app/src/main/java/org/linphone/ui/call/model/CallModel.kt +++ b/app/src/main/java/org/linphone/ui/call/model/CallModel.kt @@ -42,7 +42,7 @@ class CallModel @WorkerThread constructor(val call: Call) { val isPaused = MutableLiveData() - val friend = coreContext.contactsManager.findContactByAddress(call.remoteAddress) + val friend = coreContext.contactsManager.findContactByAddress(call.callLog.remoteAddress) val contact = MutableLiveData() @@ -58,16 +58,17 @@ class CallModel @WorkerThread constructor(val call: Call) { call.addListener(callListener) val conferenceInfo = coreContext.core.findConferenceInformationFromUri(call.remoteAddress) + val remoteAddress = call.callLog.remoteAddress val avatarModel = if (conferenceInfo != null) { coreContext.contactsManager.getContactAvatarModelForConferenceInfo(conferenceInfo) } else { coreContext.contactsManager.getContactAvatarModelForAddress( - call.remoteAddress + remoteAddress ) } contact.postValue(avatarModel) displayName.postValue( - avatarModel.friend.name ?: LinphoneUtils.getDisplayName(call.remoteAddress) + avatarModel.friend.name ?: LinphoneUtils.getDisplayName(remoteAddress) ) state.postValue(LinphoneUtils.callStateToString(call.state)) diff --git a/app/src/main/java/org/linphone/ui/call/viewmodel/CallsViewModel.kt b/app/src/main/java/org/linphone/ui/call/viewmodel/CallsViewModel.kt index d2d8fe85b..0ee91f92a 100644 --- a/app/src/main/java/org/linphone/ui/call/viewmodel/CallsViewModel.kt +++ b/app/src/main/java/org/linphone/ui/call/viewmodel/CallsViewModel.kt @@ -245,15 +245,16 @@ class CallsViewModel @UiThread constructor() : GenericViewModel() { } callsTopBarIcon.postValue(R.drawable.phone_pause) if (found != null) { + val remoteAddress = found.callLog.remoteAddress val conference = found.conference if (conference != null) { callsTopBarLabel.postValue(conference.subject) } else { val contact = coreContext.contactsManager.findContactByAddress( - found.remoteAddress + remoteAddress ) callsTopBarLabel.postValue( - contact?.name ?: LinphoneUtils.getDisplayName(found.remoteAddress) + contact?.name ?: LinphoneUtils.getDisplayName(remoteAddress) ) } callsTopBarStatus.postValue(LinphoneUtils.callStateToString(found.state)) @@ -275,11 +276,12 @@ class CallsViewModel @UiThread constructor() : GenericViewModel() { if (conference != null) { callsTopBarLabel.postValue(conference.subject) } else { + val remoteAddress = call.callLog.remoteAddress val contact = coreContext.contactsManager.findContactByAddress( - call.remoteAddress + remoteAddress ) callsTopBarLabel.postValue( - contact?.name ?: LinphoneUtils.getDisplayName(call.remoteAddress) + contact?.name ?: LinphoneUtils.getDisplayName(remoteAddress) ) } callsTopBarStatus.postValue(LinphoneUtils.callStateToString(call.state)) diff --git a/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt b/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt index 13898fa8b..7f91fec70 100644 --- a/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt +++ b/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt @@ -1118,7 +1118,7 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() { isPausedByRemote.postValue(call.state == Call.State.PausedByRemote) canBePaused.postValue(canCallBePaused()) - val address = call.remoteAddress + val address = call.callLog.remoteAddress val uri = if (corePreferences.onlyDisplaySipUriUsername) { address.username ?: "" } else { diff --git a/app/src/main/java/org/linphone/ui/main/viewmodel/MainViewModel.kt b/app/src/main/java/org/linphone/ui/main/viewmodel/MainViewModel.kt index 07bf8fdef..b2ed30681 100644 --- a/app/src/main/java/org/linphone/ui/main/viewmodel/MainViewModel.kt +++ b/app/src/main/java/org/linphone/ui/main/viewmodel/MainViewModel.kt @@ -398,7 +398,7 @@ class MainViewModel @UiThread constructor() : ViewModel() { val currentCall = core.currentCall ?: core.calls.firstOrNull() if (currentCall != null) { - val address = currentCall.remoteAddress + val address = currentCall.callLog.remoteAddress val contact = coreContext.contactsManager.findContactByAddress(address) val label = if (contact != null) { contact.name ?: LinphoneUtils.getDisplayName(address)