From 068d2d2902e4c3bb0a080ef5ac9841bd4e506b94 Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Wed, 18 Mar 2026 15:05:16 +0100 Subject: [PATCH] Fix media encryption state in CallView --- Linphone/GeneratedGit.swift | 2 +- Linphone/UI/Call/CallView.swift | 2 +- Linphone/UI/Call/ViewModel/CallViewModel.swift | 12 +++++------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Linphone/GeneratedGit.swift b/Linphone/GeneratedGit.swift index 7736678ca..5a4eafd24 100644 --- a/Linphone/GeneratedGit.swift +++ b/Linphone/GeneratedGit.swift @@ -2,6 +2,6 @@ import Foundation public enum AppGitInfo { public static let branch = "master" - public static let commit = "1ffcd3e1a" + public static let commit = "1943f0f21" public static let tag = "6.1.0-alpha" } diff --git a/Linphone/UI/Call/CallView.swift b/Linphone/UI/Call/CallView.swift index 3ff1db95c..67a9c91d3 100644 --- a/Linphone/UI/Call/CallView.swift +++ b/Linphone/UI/Call/CallView.swift @@ -408,7 +408,7 @@ struct CallView: View { .zIndex(1) } else if callViewModel.isNotEncrypted { HStack { - Image("lock_simple") + Image("lock-simple-open") .renderingMode(.template) .resizable() .foregroundStyle(.white) diff --git a/Linphone/UI/Call/ViewModel/CallViewModel.swift b/Linphone/UI/Call/ViewModel/CallViewModel.swift index 203750528..a5722f1cf 100644 --- a/Linphone/UI/Call/ViewModel/CallViewModel.swift +++ b/Linphone/UI/Call/ViewModel/CallViewModel.swift @@ -275,7 +275,7 @@ class CallViewModel: ObservableObject { } } - self.callDelegate = CallDelegateStub(onEncryptionChanged: { (_: Call, _: Bool, _: String)in + self.callDelegate = CallDelegateStub(onEncryptionChanged: { (_: Call, _: Bool, _: String) in DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { self.updateEncryption(withToast: false) } @@ -297,10 +297,6 @@ class CallViewModel: ObservableObject { self.zrtpPopupDisplayed = true } } - }, onStateChanged: { (_: Call, state: Call.State, message: String) in - if let currentParamsTmp = self.currentCall?.currentParams, state == .StreamsRunning, currentParamsTmp.mediaEncryption == .None || currentParamsTmp.mediaEncryption == .SRTP { - self.updateEncryption(withToast: false) - } }, onStatsUpdated: { (_: Call, stats: CallStats) in DispatchQueue.main.async { if self.currentCall != nil { @@ -994,9 +990,11 @@ class CallViewModel: ObservableObject { self.isNotEncrypted = false } case MediaEncryption.None: - let isNotEncryptedTmp = self.currentCall?.state == .StreamsRunning && !self.telecomManager.outgoingCallStarted + let isMediaEncryptedTmp = self.currentCall?.params?.mediaEncryption != .None && self.currentCall?.params?.mediaEncryption != .ZRTP + let isNotEncryptedTmp = self.currentCall?.params?.mediaEncryption == .None + DispatchQueue.main.async { - self.isMediaEncrypted = false + self.isMediaEncrypted = isMediaEncryptedTmp self.isZrtp = false self.isNotEncrypted = isNotEncryptedTmp }