Fixed self avatar not displayed in call views

This commit is contained in:
Sylvain Berfini 2025-12-15 14:15:13 +01:00
parent e8c67fdd6f
commit be47deeb40

View file

@ -1193,7 +1193,8 @@ class CurrentCallViewModel
val model = if (conferenceInfo != null) { val model = if (conferenceInfo != null) {
coreContext.contactsManager.getContactAvatarModelForConferenceInfo(conferenceInfo) coreContext.contactsManager.getContactAvatarModelForConferenceInfo(conferenceInfo)
} else { } else {
// Do not use contact avatar model from ContactsManager // Do not use contact avatar model from ContactsManager to be able to show
// ZRTP verification status with the device that will answer the call
val friend = coreContext.contactsManager.findContactByAddress(address) val friend = coreContext.contactsManager.findContactByAddress(address)
if (friend != null) { if (friend != null) {
ContactAvatarModel(friend, address) ContactAvatarModel(friend, address)
@ -1201,6 +1202,12 @@ class CurrentCallViewModel
val fakeFriend = coreContext.core.createFriend() val fakeFriend = coreContext.core.createFriend()
fakeFriend.name = LinphoneUtils.getDisplayName(address) fakeFriend.name = LinphoneUtils.getDisplayName(address)
fakeFriend.address = address fakeFriend.address = address
val localAccount = coreContext.core.accountList.find {
it.params.identityAddress?.weakEqual(address) == true
}
if (localAccount != null) {
fakeFriend.photo = localAccount.params.pictureUri
}
ContactAvatarModel(fakeFriend, address) ContactAvatarModel(fakeFriend, address)
} }
} }