mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Improved called account display
This commit is contained in:
parent
b1b1ab0d8a
commit
6ba8760be7
1 changed files with 13 additions and 1 deletions
|
|
@ -1115,7 +1115,19 @@ class CurrentCallViewModel
|
|||
if (call.dir == Call.Dir.Incoming) {
|
||||
val isVideo = call.remoteParams?.isVideoEnabled == true && call.remoteParams?.videoDirection != MediaDirection.Inactive
|
||||
if (call.core.accountList.size > 1) {
|
||||
val displayName = LinphoneUtils.getDisplayName(call.toAddress)
|
||||
val localAddress = call.callLog.toAddress
|
||||
Log.i("$TAG Local address for incoming call is [${localAddress.asStringUriOnly()}]")
|
||||
val localAccount = coreContext.core.accountList.find {
|
||||
it.params.identityAddress?.weakEqual(localAddress) == true
|
||||
}
|
||||
val displayName = if (localAccount != null) {
|
||||
LinphoneUtils.getDisplayName(localAccount.params.identityAddress)
|
||||
} else {
|
||||
Log.w("$TAG Matching local account was not found, using TO address display name or username")
|
||||
LinphoneUtils.getDisplayName(localAddress)
|
||||
}
|
||||
Log.i("$TAG Showing account being called as [$displayName]")
|
||||
|
||||
if (isVideo) {
|
||||
incomingCallTitle.postValue(
|
||||
AppUtils.getFormattedString(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue