Fix media encryption state in CallView

This commit is contained in:
Benoit Martins 2026-03-18 15:05:16 +01:00
parent 1943f0f21c
commit 068d2d2902
3 changed files with 7 additions and 9 deletions

View file

@ -2,6 +2,6 @@ import Foundation
public enum AppGitInfo { public enum AppGitInfo {
public static let branch = "master" public static let branch = "master"
public static let commit = "1ffcd3e1a" public static let commit = "1943f0f21"
public static let tag = "6.1.0-alpha" public static let tag = "6.1.0-alpha"
} }

View file

@ -408,7 +408,7 @@ struct CallView: View {
.zIndex(1) .zIndex(1)
} else if callViewModel.isNotEncrypted { } else if callViewModel.isNotEncrypted {
HStack { HStack {
Image("lock_simple") Image("lock-simple-open")
.renderingMode(.template) .renderingMode(.template)
.resizable() .resizable()
.foregroundStyle(.white) .foregroundStyle(.white)

View file

@ -297,10 +297,6 @@ class CallViewModel: ObservableObject {
self.zrtpPopupDisplayed = true 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 }, onStatsUpdated: { (_: Call, stats: CallStats) in
DispatchQueue.main.async { DispatchQueue.main.async {
if self.currentCall != nil { if self.currentCall != nil {
@ -994,9 +990,11 @@ class CallViewModel: ObservableObject {
self.isNotEncrypted = false self.isNotEncrypted = false
} }
case MediaEncryption.None: 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 { DispatchQueue.main.async {
self.isMediaEncrypted = false self.isMediaEncrypted = isMediaEncryptedTmp
self.isZrtp = false self.isZrtp = false
self.isNotEncrypted = isNotEncryptedTmp self.isNotEncrypted = isNotEncryptedTmp
} }