Display toast of authenticated device when ZRTP SAS is validated

This commit is contained in:
Benoit Martins 2024-06-28 11:33:45 +02:00
parent 4b46322264
commit 268bff0ca3
3 changed files with 35 additions and 15 deletions

View file

@ -51,6 +51,9 @@
},
"%@" : {
},
"%@ meeting" : {
},
"%lld" : {
@ -436,6 +439,23 @@
}
}
},
"call_can_be_trusted_toast" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Authenticated device"
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Appareil authentifié"
}
}
}
},
"call_dialog_zrtp_security_alert_message" : {
"extractionState" : "manual",
"localizations" : {
@ -1155,6 +1175,9 @@
},
"Job title" : {
},
"Join the meeting now" : {
},
"Joining..." : {
@ -1206,9 +1229,6 @@
},
"New contact" : {
},
"New meeting" : {
},
"Next" : {
@ -1224,6 +1244,9 @@
},
"No meeting for the moment..." : {
},
"No meeting today" : {
},
"No participant for the moment..." : {
@ -1242,6 +1265,9 @@
},
"Opération en cours..." : {
},
"Organizer" : {
},
"Other actions" : {
@ -1463,9 +1489,6 @@
},
"The user name or password is incorrects" : {
},
"This call is completely securised" : {
},
"This contact will be deleted definitively." : {
@ -1478,9 +1501,6 @@
},
"to Linphone" : {
},
"TODO" : {
},
"TODO : repeat" : {

View file

@ -205,7 +205,7 @@ class CallViewModel: ObservableObject {
self.upperCaseAuthTokenToListen = ""
self.isNotVerified = false
self.updateEncryption()
self.updateEncryption(withToast: false)
self.isConference = false
self.participantList = []
self.activeSpeakerParticipant = nil
@ -229,7 +229,7 @@ class CallViewModel: ObservableObject {
}
self.callSuscriptions.insert(self.currentCall!.publisher?.onEncryptionChanged?.postOnCoreQueue {(cbVal: (call: Call, on: Bool, authenticationToken: String?)) in
self.updateEncryption()
self.updateEncryption(withToast: false)
if self.currentCall != nil {
self.callMediaEncryptionModel.update(call: self.currentCall!)
}
@ -247,7 +247,7 @@ class CallViewModel: ObservableObject {
self.currentCall!.publisher?.onAuthenticationTokenVerified?.postOnCoreQueue {(call: Call, verified: Bool) in
Log.warn("[CallViewModel][ZRTPPopup] Notified that authentication token is \(verified ? "verified" : "not verified!")")
if verified {
self.updateEncryption()
self.updateEncryption(withToast: true)
if self.currentCall != nil {
self.callMediaEncryptionModel.update(call: self.currentCall!)
}
@ -916,7 +916,7 @@ class CallViewModel: ObservableObject {
}
}
private func updateEncryption() {
private func updateEncryption(withToast: Bool) {
coreContext.doOnCoreQueue { _ in
if self.currentCall != nil && self.currentCall!.currentParams != nil {
switch self.currentCall!.currentParams!.mediaEncryption {
@ -952,7 +952,7 @@ class CallViewModel: ObservableObject {
self.cacheMismatch = cacheMismatchFlag
self.isNotEncrypted = false
if isDeviceTrusted {
if isDeviceTrusted && withToast {
ToastViewModel.shared.toastMessage = "Info_call_securised"
ToastViewModel.shared.displayToast = true
}

View file

@ -82,7 +82,7 @@ struct ToastView: View {
.padding(8)
case "Info_call_securised":
Text("This call is completely securised")
Text("call_can_be_trusted_toast")
.multilineTextAlignment(.center)
.foregroundStyle(Color.blueInfo500)
.default_text_style(styleSize: 15)