Do ZRTP SAS validation again button now working

This commit is contained in:
Sylvain Berfini 2024-03-18 11:21:32 +01:00
parent 91e0cb5838
commit 34c3dff137
2 changed files with 7 additions and 8 deletions

View file

@ -26,9 +26,10 @@ import org.linphone.core.Call
import org.linphone.core.MediaEncryption
import org.linphone.core.StreamType
import org.linphone.utils.AppUtils
import org.linphone.utils.Event
class CallMediaEncryptionModel @WorkerThread constructor() {
class CallMediaEncryptionModel @WorkerThread constructor(
private val showZrtpSasValidationDialog: () -> Unit
) {
val mediaEncryption = MutableLiveData<String>()
val isMediaEncryptionZrtp = MutableLiveData<Boolean>()
@ -38,10 +39,6 @@ class CallMediaEncryptionModel @WorkerThread constructor() {
val zrtpAuthTag = MutableLiveData<String>()
val zrtpAuthSas = MutableLiveData<String>()
val showZrtpSasValidationDialogEvent: MutableLiveData<Event<Boolean>> by lazy {
MutableLiveData<Event<Boolean>>()
}
@WorkerThread
fun update(call: Call) {
isMediaEncryptionZrtp.postValue(false)
@ -112,6 +109,6 @@ class CallMediaEncryptionModel @WorkerThread constructor() {
}
fun showSasValidationDialog() {
showZrtpSasValidationDialogEvent.value = Event(true)
showZrtpSasValidationDialog.invoke()
}
}

View file

@ -106,7 +106,9 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
val callStatsModel = CallStatsModel()
val callMediaEncryptionModel = CallMediaEncryptionModel()
val callMediaEncryptionModel = CallMediaEncryptionModel() {
showZrtpSasDialogIfPossible()
}
val incomingCallTitle: MutableLiveData<String> by lazy {
MutableLiveData<String>()