diff --git a/Linphone/UI/Main/Conversations/ViewModel/ConversationsListViewModel.swift b/Linphone/UI/Main/Conversations/ViewModel/ConversationsListViewModel.swift index 7c268dd35..0393ccd6e 100644 --- a/Linphone/UI/Main/Conversations/ViewModel/ConversationsListViewModel.swift +++ b/Linphone/UI/Main/Conversations/ViewModel/ConversationsListViewModel.swift @@ -118,23 +118,6 @@ class ConversationsListViewModel: ObservableObject { } } } - } else if !conversationModel.isGroup { - if let address = conversationModel.participantsAddress.first { - let avatarModelTmp = ContactsManager.shared.avatarListModel.first(where: { - guard let friend = $0.friend else { return false } - return friend.name == conversationModel.subject && - friend.address?.asStringUriOnly() == address - }) ?? ContactAvatarModel( - friend: nil, - name: conversationModel.subject, - address: address, - withPresence: false - ) - - DispatchQueue.main.async { - conversationModel.avatarModel = avatarModelTmp - } - } } } } diff --git a/Linphone/Utils/Avatar.swift b/Linphone/Utils/Avatar.swift index 780f4b038..60185e5e1 100644 --- a/Linphone/Utils/Avatar.swift +++ b/Linphone/Utils/Avatar.swift @@ -36,11 +36,11 @@ struct Avatar: View { } var body: some View { - if let photoPath = contactAvatarModel.friend?.photo { - let uniqueUrl = ContactsManager.shared.getImagePath(friendPhotoPath: photoPath) - let finalUrl = uniqueUrl.appendingQueryItem("v", value: UUID().uuidString) + if !contactAvatarModel.photo.isEmpty { + let uniqueUrl = ContactsManager.shared.getImagePath(friendPhotoPath: contactAvatarModel.photo) + //let finalUrl = uniqueUrl.appendingQueryItem("v", value: UUID().uuidString) - AsyncImage(url: finalUrl) { image in + AsyncImage(url: uniqueUrl) { image in switch image { case .empty: ProgressView()