From 9413f6f5dcdd630977e8f45ae9ff927372d43c92 Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Thu, 30 Oct 2025 17:52:42 +0100 Subject: [PATCH] Update encryption when call state changes --- Linphone/UI/Call/ViewModel/CallViewModel.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Linphone/UI/Call/ViewModel/CallViewModel.swift b/Linphone/UI/Call/ViewModel/CallViewModel.swift index 010300aa3..9c5c97dd5 100644 --- a/Linphone/UI/Call/ViewModel/CallViewModel.swift +++ b/Linphone/UI/Call/ViewModel/CallViewModel.swift @@ -292,6 +292,10 @@ 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 { @@ -986,7 +990,7 @@ class CallViewModel: ObservableObject { self.isNotEncrypted = false } case MediaEncryption.None: - let isNotEncryptedTmp = self.currentCall?.state == .StreamsRunning + let isNotEncryptedTmp = self.currentCall?.state == .StreamsRunning && !self.telecomManager.outgoingCallStarted DispatchQueue.main.async { self.isMediaEncrypted = false self.isZrtp = false