diff --git a/Linphone/core/call/CallCore.cpp b/Linphone/core/call/CallCore.cpp index 1a56a234d..b4544908e 100644 --- a/Linphone/core/call/CallCore.cpp +++ b/Linphone/core/call/CallCore.cpp @@ -159,6 +159,11 @@ CallCore::CallCore(const std::shared_ptr &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 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 core = conference ? ConferenceCore::create(conference) : nullptr; - mCallModelConnection->invokeToCore([this, core]() { setConference(core); }); - }); + mCallModelConnection->makeConnectToModel( + &CallModel::conferenceChanged, [this](const std::shared_ptr &conference) { + // Force enable video if in conference to handle screen sharing + if (conference && !mCallModel->videoEnabled()) mCallModel->enableVideo(true); + QSharedPointer 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: diff --git a/Linphone/core/call/CallCore.hpp b/Linphone/core/call/CallCore.hpp index 1ed2f6529..4c448a806 100644 --- a/Linphone/core/call/CallCore.hpp +++ b/Linphone/core/call/CallCore.hpp @@ -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; diff --git a/Linphone/model/call/CallModel.cpp b/Linphone/model/call/CallModel.cpp index 26ddb01d1..8a3ea382f 100644 --- a/Linphone/model/call/CallModel.cpp +++ b/Linphone/model/call/CallModel.cpp @@ -283,7 +283,7 @@ void CallModel::setConference(const std::shared_ptr &confe mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); if (mConference != conference) { mConference = conference; - emit conferenceChanged(); + emit conferenceChanged(conference); } } diff --git a/Linphone/model/call/CallModel.hpp b/Linphone/model/call/CallModel.hpp index f9549b442..fce48f944 100644 --- a/Linphone/model/call/CallModel.hpp +++ b/Linphone/model/call/CallModel.hpp @@ -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 &conference); void conferenceVideoLayoutChanged(LinphoneEnums::ConferenceLayout layout); void videoDescriptorChanged(); void errorMessageChanged(const QString &error); diff --git a/Linphone/model/conference/ConferenceModel.cpp b/Linphone/model/conference/ConferenceModel.cpp index 859b49b5f..6220ca1a2 100644 --- a/Linphone/model/conference/ConferenceModel.cpp +++ b/Linphone/model/conference/ConferenceModel.cpp @@ -288,6 +288,13 @@ void ConferenceModel::onAudioDeviceChanged(const std::shared_ptr &conference, + const std::shared_ptr &participantDevice, + bool isMuted) { + emit participantDeviceIsMuted(conference, participantDevice, isMuted); +} + void ConferenceModel::onIsScreenSharingEnabledChanged() { auto call = mMonitor->getCall(); std::shared_ptr params = CoreModel::getInstance()->getCore()->createCallParams(call); diff --git a/Linphone/model/conference/ConferenceModel.hpp b/Linphone/model/conference/ConferenceModel.hpp index 23f9aa087..dfe6dca5f 100644 --- a/Linphone/model/conference/ConferenceModel.hpp +++ b/Linphone/model/conference/ConferenceModel.hpp @@ -120,6 +120,9 @@ private: const std::string &subject) override; virtual void onAudioDeviceChanged(const std::shared_ptr &conference, const std::shared_ptr &audioDevice) override; + virtual void onParticipantDeviceIsMuted(const std::shared_ptr &conference, + const std::shared_ptr &participantDevice, + bool isMuted) override; signals: void activeSpeakerParticipantDevice(const std::shared_ptr &conference, @@ -144,6 +147,9 @@ signals: void conferenceStateChanged(const std::shared_ptr &conference, linphone::Conference::State newState); void subjectChanged(const std::string &subject); + void participantDeviceIsMuted(const std::shared_ptr &conference, + const std::shared_ptr &participantDevice, + bool isMuted); private: QTimer mDurationTimer; diff --git a/Linphone/tool/LinphoneEnums.cpp b/Linphone/tool/LinphoneEnums.cpp index c64d82dd5..ccd560a5d 100644 --- a/Linphone/tool/LinphoneEnums.cpp +++ b/Linphone/tool/LinphoneEnums.cpp @@ -30,6 +30,7 @@ void LinphoneEnums::registerMetaTypes() { qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); + qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); @@ -209,6 +210,27 @@ LinphoneEnums::SecurityLevel LinphoneEnums::fromLinphone(const linphone::Securit return static_cast(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(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(data); } diff --git a/Linphone/tool/LinphoneEnums.hpp b/Linphone/tool/LinphoneEnums.hpp index 849b870f4..47a547658 100644 --- a/Linphone/tool/LinphoneEnums.hpp +++ b/Linphone/tool/LinphoneEnums.hpp @@ -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) diff --git a/Linphone/view/Control/Popup/Notification/Notification.qml b/Linphone/view/Control/Popup/Notification/Notification.qml index c18fd5dbf..375f08342 100644 --- a/Linphone/view/Control/Popup/Notification/Notification.qml +++ b/Linphone/view/Control/Popup/Notification/Notification.qml @@ -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 - } } diff --git a/Linphone/view/Page/Window/Call/CallsWindow.qml b/Linphone/view/Page/Window/Call/CallsWindow.qml index e59d8bb1c..0142bc81e 100644 --- a/Linphone/view/Page/Window/Call/CallsWindow.qml +++ b/Linphone/view/Page/Window/Call/CallsWindow.qml @@ -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