mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-07 15:08:24 +00:00
fix #LINQT-1697 wrong encryption status on paused
This commit is contained in:
parent
9dc1f3a4aa
commit
34f914ca55
4 changed files with 56 additions and 39 deletions
|
|
@ -150,6 +150,7 @@ CallCore::CallCore(const std::shared_ptr<linphone::Call> &call) : QObject(nullpt
|
|||
mZrtpStats.mHashAlgorithm = Utils::coreStringToAppString(stats->getZrtpHashAlgo());
|
||||
mZrtpStats.mAuthenticationAlgorithm = Utils::coreStringToAppString(stats->getZrtpAuthTagAlgo());
|
||||
mZrtpStats.mSasAlgorithm = Utils::coreStringToAppString(stats->getZrtpSasAlgo());
|
||||
mZrtpStats.mIsPostQuantum = stats->isZrtpKeyAgreementAlgoPostQuantum();
|
||||
}
|
||||
}
|
||||
auto conference = call->getConference();
|
||||
|
|
@ -307,9 +308,9 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
|
|||
[this, call, encryption, tokenVerified, localToken, remoteTokens, isCaseMismatch]() {
|
||||
setLocalToken(localToken);
|
||||
setRemoteTokens(remoteTokens);
|
||||
setIsMismatch(isCaseMismatch);
|
||||
setTokenVerified(tokenVerified);
|
||||
setEncryption(encryption);
|
||||
setIsMismatch(isCaseMismatch);
|
||||
setTokenVerified(tokenVerified);
|
||||
});
|
||||
auto mediaEncryption = call->getParams()->getMediaEncryption();
|
||||
if (mediaEncryption == linphone::MediaEncryption::ZRTP) {
|
||||
|
|
@ -320,6 +321,7 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
|
|||
zrtpStats.mHashAlgorithm = Utils::coreStringToAppString(stats->getZrtpHashAlgo());
|
||||
zrtpStats.mAuthenticationAlgorithm = Utils::coreStringToAppString(stats->getZrtpAuthTagAlgo());
|
||||
zrtpStats.mSasAlgorithm = Utils::coreStringToAppString(stats->getZrtpSasAlgo());
|
||||
zrtpStats.mIsPostQuantum = stats->isZrtpKeyAgreementAlgoPostQuantum();
|
||||
mCallModelConnection->invokeToCore([this, zrtpStats]() { setZrtpStats(zrtpStats); });
|
||||
}
|
||||
});
|
||||
|
|
@ -645,7 +647,22 @@ LinphoneEnums::MediaEncryption CallCore::getEncryption() const {
|
|||
}
|
||||
|
||||
QString CallCore::getEncryptionString() const {
|
||||
return LinphoneEnums::toString(mEncryption);
|
||||
switch (mEncryption) {
|
||||
case LinphoneEnums::MediaEncryption::Dtls:
|
||||
//: DTLS
|
||||
return tr("media_encryption_dtls");
|
||||
case LinphoneEnums::MediaEncryption::None:
|
||||
//: None
|
||||
return tr("media_encryption_none");
|
||||
case LinphoneEnums::MediaEncryption::Srtp:
|
||||
//: SRTP
|
||||
return tr("media_encryption_srtp");
|
||||
case LinphoneEnums::MediaEncryption::Zrtp:
|
||||
//: "ZRTP - Post quantique"
|
||||
return tr("media_encryption_post_quantum");
|
||||
default:
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
void CallCore::setEncryption(LinphoneEnums::MediaEncryption encryption) {
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ void Utils::createCall(const QString &sipAddress,
|
|||
if (!success) {
|
||||
//: "L'appel n'a pas pu être créé"
|
||||
if (errorMessage.isEmpty()) errorMessage = tr("information_popup_call_not_created_message");
|
||||
showInformationPopup("information_popup_error_title", errorMessage, false);
|
||||
showInformationPopup(tr("information_popup_error_title"), errorMessage, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,9 +31,11 @@ ColumnLayout {
|
|||
spacing: Math.round(7 * DefaultStyle.dp)
|
||||
Text {
|
||||
property bool isPostQuantum: mainItem.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp && mainItem.call.core.zrtpStats.isPostQuantum
|
||||
//: "Chiffrement du média : %1%2"
|
||||
//: "ZRTP Post Quantique"
|
||||
text: qsTr("call_stats_media_encryption").arg(isPostQuantum ? tr("call_stats_media_encryption_zrtp_post_quantum") : mainItem.call.core.encryptionString)
|
||||
//: Chiffrement du média : %1
|
||||
text: qsTr("call_stats_media_encryption").arg(isPostQuantum ?
|
||||
//: ZRTP Post Quantique
|
||||
qsTr("call_stats_media_encryption_zrtp_post_quantum")
|
||||
: mainItem.call.core.encryptionString)
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
font {
|
||||
pixelSize: Math.round(12 * DefaultStyle.dp)
|
||||
|
|
|
|||
|
|
@ -348,12 +348,17 @@ AbstractWindow {
|
|||
spacing: Math.round(10 * DefaultStyle.dp)
|
||||
Text {
|
||||
id: callStatusText
|
||||
property string remoteName: mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning
|
||||
? mainWindow.call.core.remoteName
|
||||
//: "Appel %1"
|
||||
: mainWindow.call ? qsTr("call_dir").arg(EnumsToStringCpp.dirToString(mainWindow.call.core.dir)) : ""
|
||||
//: "Appel terminé"
|
||||
property string remoteName: mainWindow.call ? qsTr("call_dir").arg(EnumsToStringCpp.dirToString(mainWindow.call.core.dir)) : ""
|
||||
Connections {
|
||||
target: mainWindow
|
||||
onCallStateChanged: {
|
||||
if (mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning)
|
||||
callStatusText.remoteName = mainWindow.call.core.remoteName
|
||||
}
|
||||
}
|
||||
|
||||
text: (mainWindow.callState === LinphoneEnums.CallState.End || mainWindow.callState === LinphoneEnums.CallState.Released)
|
||||
//: "Appel terminé"
|
||||
? qsTr("call_ended")
|
||||
: mainWindow.call && (mainWindow.call.core.paused || (mainWindow.callState === LinphoneEnums.CallState.Paused || mainWindow.callState === LinphoneEnums.CallState.PausedByRemote))
|
||||
? (mainWindow.conference
|
||||
|
|
@ -426,11 +431,7 @@ AbstractWindow {
|
|||
}
|
||||
}
|
||||
BusyIndicator {
|
||||
visible: mainWindow.call
|
||||
&& mainWindow.callState
|
||||
!= LinphoneEnums.CallState.Connected
|
||||
&& mainWindow.callState
|
||||
!= LinphoneEnums.CallState.StreamsRunning
|
||||
visible: encryptionStatusText.text === qsTr("call_waiting_for_encryption_info")
|
||||
Layout.preferredWidth: Math.round(15 * DefaultStyle.dp)
|
||||
Layout.preferredHeight: Math.round(15 * DefaultStyle.dp)
|
||||
indicatorColor: DefaultStyle.grey_0
|
||||
|
|
@ -440,10 +441,6 @@ AbstractWindow {
|
|||
Layout.preferredHeight: Math.round(15 * DefaultStyle.dp)
|
||||
colorizationColor: mainWindow.call ? mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Srtp ? DefaultStyle.info_500_main : mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp ? mainWindow.call.core.isMismatch || !mainWindow.call.core.tokenVerified ? DefaultStyle.warning_600 : DefaultStyle.info_500_main : DefaultStyle.grey_0 : "transparent"
|
||||
visible: mainWindow.call
|
||||
&& mainWindow.callState
|
||||
=== LinphoneEnums.CallState.Connected
|
||||
|| mainWindow.callState
|
||||
=== LinphoneEnums.CallState.StreamsRunning
|
||||
imageSource: mainWindow.call
|
||||
? mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Srtp
|
||||
? AppIcons.lockSimple
|
||||
|
|
@ -455,29 +452,30 @@ AbstractWindow {
|
|||
: ""
|
||||
}
|
||||
Text {
|
||||
text: mainWindow.call && mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning
|
||||
? mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Srtp
|
||||
//: "Appel chiffré de point à point"
|
||||
id: encryptionStatusText
|
||||
text: mainWindow.conference
|
||||
//: Appel chiffré de bout en bout
|
||||
? qsTr("call_zrtp_end_to_end_encrypted")
|
||||
:mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Srtp
|
||||
//: Appel chiffré de point à point
|
||||
? qsTr("call_srtp_point_to_point_encrypted")
|
||||
: mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp
|
||||
? mainWindow.call.core.isMismatch || !mainWindow.call.core.tokenVerified
|
||||
//: "Vérification nécessaire"
|
||||
//: Vérification nécessaire
|
||||
? qsTr("call_zrtp_sas_validation_required")
|
||||
//: "Appel chiffré de bout en bout"
|
||||
: qsTr("call_zrtp_end_to_end_encrypted")
|
||||
//: "Appel non chiffré"
|
||||
: qsTr("call_not_encrypted")
|
||||
//: "En attente de chiffrement"
|
||||
: qsTr("call_waiting_for_encryption_info")
|
||||
color: mainWindow.call && mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning
|
||||
? mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Srtp
|
||||
? DefaultStyle.info_500_main
|
||||
: mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp
|
||||
? mainWindow.call.core.isMismatch || !mainWindow.call.core.tokenVerified
|
||||
? DefaultStyle.warning_600
|
||||
: DefaultStyle.info_500_main
|
||||
: DefaultStyle.grey_0
|
||||
: DefaultStyle.grey_0
|
||||
: mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.None
|
||||
//: "Appel non chiffré"
|
||||
? qsTr("call_not_encrypted")
|
||||
//: "En attente de chiffrement"
|
||||
: qsTr("call_waiting_for_encryption_info")
|
||||
color: mainWindow.conference || mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Srtp
|
||||
? DefaultStyle.info_500_main
|
||||
: mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp
|
||||
? mainWindow.call.core.isMismatch || !mainWindow.call.core.tokenVerified
|
||||
? DefaultStyle.warning_600
|
||||
: DefaultStyle.info_500_main
|
||||
: DefaultStyle.grey_0
|
||||
font {
|
||||
pixelSize: Math.round(12 * DefaultStyle.dp)
|
||||
weight: Math.round(400 * DefaultStyle.dp)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue