mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-17 20:08:28 +00:00
display end to end encrypted conference label #LINQT-2436
This commit is contained in:
parent
a6f5a01ce6
commit
fbe0615cf6
10 changed files with 109 additions and 25 deletions
|
|
@ -159,6 +159,11 @@ CallCore::CallCore(const std::shared_ptr<linphone::Call> &call) : QObject(nullpt
|
|||
mIsConference = conference != nullptr;
|
||||
if (mIsConference) {
|
||||
mConference = ConferenceCore::create(conference);
|
||||
auto confInfo = conference->getInfo();
|
||||
if (conference->getCurrentParams() &&
|
||||
conference->getCurrentParams()->getSecurityLevel() == linphone::Conference::SecurityLevel::EndToEnd)
|
||||
mConferenceSecurityLevel = LinphoneEnums::fromLinphone(linphone::Conference::SecurityLevel::EndToEnd);
|
||||
mConferenceSecurityLevel = LinphoneEnums::ConferenceSecurityLevel::PointToPoint;
|
||||
}
|
||||
mMicrophoneMuted = conference ? conference->getMicrophoneMuted() : call->getMicrophoneMuted();
|
||||
mSpeakerMuted = call->getSpeakerMuted();
|
||||
|
|
@ -350,13 +355,25 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
|
|||
if (device) mCallModel->setOutputAudioDevice(device);
|
||||
});
|
||||
});
|
||||
mCallModelConnection->makeConnectToModel(&CallModel::conferenceChanged, [this]() {
|
||||
auto conference = mCallModel->getMonitor()->getConference();
|
||||
// Force enable video if in conference to handle screen sharing
|
||||
if (conference && !mCallModel->videoEnabled()) mCallModel->enableVideo(true);
|
||||
QSharedPointer<ConferenceCore> core = conference ? ConferenceCore::create(conference) : nullptr;
|
||||
mCallModelConnection->invokeToCore([this, core]() { setConference(core); });
|
||||
});
|
||||
mCallModelConnection->makeConnectToModel(
|
||||
&CallModel::conferenceChanged, [this](const std::shared_ptr<linphone::Conference> &conference) {
|
||||
// Force enable video if in conference to handle screen sharing
|
||||
if (conference && !mCallModel->videoEnabled()) mCallModel->enableVideo(true);
|
||||
QSharedPointer<ConferenceCore> core = conference ? ConferenceCore::create(conference) : nullptr;
|
||||
if (conference) {
|
||||
LinphoneEnums::ConferenceSecurityLevel level;
|
||||
lInfo() << log().arg("Conference changed %1, security level is")
|
||||
<< (conference->getCurrentParams()
|
||||
? LinphoneEnums::toString(conference->getCurrentParams()->getSecurityLevel())
|
||||
: "no conference params");
|
||||
if (conference->getCurrentParams() &&
|
||||
conference->getCurrentParams()->getSecurityLevel() == linphone::Conference::SecurityLevel::EndToEnd)
|
||||
level = LinphoneEnums::ConferenceSecurityLevel::EndToEnd;
|
||||
else level = LinphoneEnums::ConferenceSecurityLevel::PointToPoint;
|
||||
mCallModelConnection->invokeToCore([this, level]() { setConferenceSecurityLevel(level); });
|
||||
}
|
||||
mCallModelConnection->invokeToCore([this, core]() { setConference(core); });
|
||||
});
|
||||
mCallModelConnection->makeConnectToCore(&CallCore::lAccept, [this](bool withVideo) {
|
||||
mCallModelConnection->invokeToModel([this, withVideo]() { mCallModel->accept(withVideo); });
|
||||
});
|
||||
|
|
@ -707,6 +724,17 @@ LinphoneEnums::MediaEncryption CallCore::getEncryption() const {
|
|||
return mEncryption;
|
||||
}
|
||||
|
||||
LinphoneEnums::ConferenceSecurityLevel CallCore::getConferenceSecurityLevel() const {
|
||||
return mConferenceSecurityLevel;
|
||||
}
|
||||
|
||||
void CallCore::setConferenceSecurityLevel(LinphoneEnums::ConferenceSecurityLevel level) {
|
||||
if (mConferenceSecurityLevel != level) {
|
||||
mConferenceSecurityLevel = level;
|
||||
emit conferenceSecurityLevelChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QString CallCore::getEncryptionString() const {
|
||||
switch (mEncryption) {
|
||||
case LinphoneEnums::MediaEncryption::Dtls:
|
||||
|
|
|
|||
|
|
@ -112,6 +112,8 @@ public:
|
|||
Q_PROPERTY(bool tokenVerified READ getTokenVerified WRITE setTokenVerified NOTIFY securityUpdated)
|
||||
Q_PROPERTY(bool isMismatch READ isMismatch WRITE setIsMismatch NOTIFY securityUpdated)
|
||||
Q_PROPERTY(LinphoneEnums::MediaEncryption encryption READ getEncryption NOTIFY securityUpdated)
|
||||
Q_PROPERTY(LinphoneEnums::ConferenceSecurityLevel conferenceSecurityLevel READ getConferenceSecurityLevel NOTIFY
|
||||
conferenceSecurityLevelChanged)
|
||||
Q_PROPERTY(QString encryptionString READ getEncryptionString NOTIFY securityUpdated)
|
||||
Q_PROPERTY(QString localToken READ getLocalToken WRITE setLocalToken MEMBER mLocalToken NOTIFY localTokenChanged)
|
||||
Q_PROPERTY(QStringList remoteTokens WRITE setRemoteTokens MEMBER mRemoteTokens NOTIFY remoteTokensChanged)
|
||||
|
|
@ -195,6 +197,9 @@ public:
|
|||
QString getEncryptionString() const;
|
||||
void setEncryption(LinphoneEnums::MediaEncryption encryption);
|
||||
|
||||
LinphoneEnums::ConferenceSecurityLevel getConferenceSecurityLevel() const;
|
||||
void setConferenceSecurityLevel(LinphoneEnums::ConferenceSecurityLevel level);
|
||||
|
||||
bool getRemoteVideoEnabled() const;
|
||||
void setRemoteVideoEnabled(bool enabled);
|
||||
|
||||
|
|
@ -253,6 +258,7 @@ signals:
|
|||
void pausedChanged();
|
||||
void transferStateChanged();
|
||||
void securityUpdated();
|
||||
void conferenceSecurityLevelChanged();
|
||||
void tokenVerified();
|
||||
void localTokenChanged();
|
||||
void remoteTokensChanged();
|
||||
|
|
@ -321,6 +327,7 @@ private:
|
|||
LinphoneEnums::CallDir mDir;
|
||||
LinphoneEnums::ConferenceLayout mConferenceVideoLayout;
|
||||
LinphoneEnums::MediaEncryption mEncryption;
|
||||
LinphoneEnums::ConferenceSecurityLevel mConferenceSecurityLevel;
|
||||
|
||||
QString mLastErrorMessage;
|
||||
QString mRemoteName;
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ void CallModel::setConference(const std::shared_ptr<linphone::Conference> &confe
|
|||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
if (mConference != conference) {
|
||||
mConference = conference;
|
||||
emit conferenceChanged();
|
||||
emit conferenceChanged(conference);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ signals:
|
|||
void microphoneVolumeGainChanged(float volume);
|
||||
void inputAudioDeviceChanged(const std::string &id);
|
||||
void outputAudioDeviceChanged(const std::string &id);
|
||||
void conferenceChanged();
|
||||
void conferenceChanged(const std::shared_ptr<linphone::Conference> &conference);
|
||||
void conferenceVideoLayoutChanged(LinphoneEnums::ConferenceLayout layout);
|
||||
void videoDescriptorChanged();
|
||||
void errorMessageChanged(const QString &error);
|
||||
|
|
|
|||
|
|
@ -288,6 +288,13 @@ void ConferenceModel::onAudioDeviceChanged(const std::shared_ptr<linphone::Confe
|
|||
lDebug() << "onAudioDeviceChanged is not yet implemented.";
|
||||
}
|
||||
|
||||
void ConferenceModel::onParticipantDeviceIsMuted(
|
||||
const std::shared_ptr<linphone::Conference> &conference,
|
||||
const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice,
|
||||
bool isMuted) {
|
||||
emit participantDeviceIsMuted(conference, participantDevice, isMuted);
|
||||
}
|
||||
|
||||
void ConferenceModel::onIsScreenSharingEnabledChanged() {
|
||||
auto call = mMonitor->getCall();
|
||||
std::shared_ptr<linphone::CallParams> params = CoreModel::getInstance()->getCore()->createCallParams(call);
|
||||
|
|
|
|||
|
|
@ -120,6 +120,9 @@ private:
|
|||
const std::string &subject) override;
|
||||
virtual void onAudioDeviceChanged(const std::shared_ptr<linphone::Conference> &conference,
|
||||
const std::shared_ptr<const linphone::AudioDevice> &audioDevice) override;
|
||||
virtual void onParticipantDeviceIsMuted(const std::shared_ptr<linphone::Conference> &conference,
|
||||
const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice,
|
||||
bool isMuted) override;
|
||||
|
||||
signals:
|
||||
void activeSpeakerParticipantDevice(const std::shared_ptr<linphone::Conference> &conference,
|
||||
|
|
@ -144,6 +147,9 @@ signals:
|
|||
void conferenceStateChanged(const std::shared_ptr<linphone::Conference> &conference,
|
||||
linphone::Conference::State newState);
|
||||
void subjectChanged(const std::string &subject);
|
||||
void participantDeviceIsMuted(const std::shared_ptr<linphone::Conference> &conference,
|
||||
const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice,
|
||||
bool isMuted);
|
||||
|
||||
private:
|
||||
QTimer mDurationTimer;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ void LinphoneEnums::registerMetaTypes() {
|
|||
qRegisterMetaType<LinphoneEnums::CallState>();
|
||||
qRegisterMetaType<LinphoneEnums::CallStatus>();
|
||||
qRegisterMetaType<LinphoneEnums::SecurityLevel>();
|
||||
qRegisterMetaType<LinphoneEnums::ConferenceSecurityLevel>();
|
||||
qRegisterMetaType<LinphoneEnums::ChatMessageState>();
|
||||
qRegisterMetaType<LinphoneEnums::ChatRoomState>();
|
||||
qRegisterMetaType<LinphoneEnums::ConferenceLayout>();
|
||||
|
|
@ -209,6 +210,27 @@ LinphoneEnums::SecurityLevel LinphoneEnums::fromLinphone(const linphone::Securit
|
|||
return static_cast<LinphoneEnums::SecurityLevel>(level);
|
||||
}
|
||||
|
||||
linphone::Conference::SecurityLevel LinphoneEnums::toLinphone(const LinphoneEnums::ConferenceSecurityLevel &level) {
|
||||
return linphone::Conference::SecurityLevel();
|
||||
}
|
||||
|
||||
LinphoneEnums::ConferenceSecurityLevel LinphoneEnums::fromLinphone(const linphone::Conference::SecurityLevel &level) {
|
||||
return static_cast<LinphoneEnums::ConferenceSecurityLevel>(level);
|
||||
}
|
||||
|
||||
QString LinphoneEnums::toString(const linphone::Conference::SecurityLevel &level) {
|
||||
switch (level) {
|
||||
case linphone::Conference::SecurityLevel::EndToEnd:
|
||||
return "End to end";
|
||||
case linphone::Conference::SecurityLevel::PointToPoint:
|
||||
return "Point to point";
|
||||
case linphone::Conference::SecurityLevel::None:
|
||||
return "None";
|
||||
default:
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
LinphoneEnums::CallDir LinphoneEnums::fromLinphone(const linphone::Call::Dir &data) {
|
||||
return static_cast<LinphoneEnums::CallDir>(data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,6 +178,17 @@ Q_ENUM_NS(SecurityLevel)
|
|||
linphone::SecurityLevel toLinphone(const LinphoneEnums::SecurityLevel &level);
|
||||
LinphoneEnums::SecurityLevel fromLinphone(const linphone::SecurityLevel &level);
|
||||
|
||||
enum class ConferenceSecurityLevel {
|
||||
None = int(linphone::Conference::SecurityLevel::None),
|
||||
PointToPoint = int(linphone::Conference::SecurityLevel::PointToPoint),
|
||||
EndToEnd = int(linphone::Conference::SecurityLevel::EndToEnd)
|
||||
};
|
||||
Q_ENUM_NS(ConferenceSecurityLevel)
|
||||
|
||||
linphone::Conference::SecurityLevel toLinphone(const LinphoneEnums::ConferenceSecurityLevel &level);
|
||||
LinphoneEnums::ConferenceSecurityLevel fromLinphone(const linphone::Conference::SecurityLevel &level);
|
||||
QString toString(const linphone::Conference::SecurityLevel &level);
|
||||
|
||||
enum class CallDir { Outgoing = int(linphone::Call::Dir::Outgoing), Incoming = int(linphone::Call::Dir::Incoming) };
|
||||
Q_ENUM_NS(CallDir)
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ DesktopPopup {
|
|||
property double radius: 0
|
||||
property color backgroundColor: DefaultStyle.grey_0
|
||||
property double backgroundOpacity: 1
|
||||
default property alias _content: content.data
|
||||
|
||||
signal deleteNotification (var notification)
|
||||
width: mainItem.overriddenWidth
|
||||
|
|
@ -70,8 +69,4 @@ DesktopPopup {
|
|||
}
|
||||
}
|
||||
}
|
||||
Item {
|
||||
id: content
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -499,17 +499,21 @@ AbstractWindow {
|
|||
EffectImage {
|
||||
Layout.preferredWidth: Utils.getSizeWithScreenRatio(15)
|
||||
Layout.preferredHeight: Utils.getSizeWithScreenRatio(15)
|
||||
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"
|
||||
colorizationColor: mainWindow.conference
|
||||
? DefaultStyle.info_500_main
|
||||
: 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
|
||||
imageSource: mainWindow.call
|
||||
imageSource: mainWindow.conference
|
||||
? AppIcons.lockKey
|
||||
: mainWindow.call
|
||||
? mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Srtp
|
||||
? AppIcons.lockSimple
|
||||
: mainWindow.call && mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp
|
||||
|
|
@ -522,7 +526,11 @@ AbstractWindow {
|
|||
Text {
|
||||
id: encryptionStatusText
|
||||
text: mainWindow.conference
|
||||
? qsTr("call_srtp_point_to_point_encrypted")
|
||||
? mainWindow.call.core.conferenceSecurityLevel === LinphoneEnums.ConferenceSecurityLevel.EndToEnd
|
||||
//: End to end encrypted meeting
|
||||
? qsTr("conference_end_to_end_encrypted")
|
||||
//: Point to point encrypted meeting
|
||||
: qsTr("conference_srtp_point_to_point_encrypted")
|
||||
: mainWindow.call
|
||||
? mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Srtp
|
||||
//: Appel chiffré de point à point
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue