diff --git a/src/app/calladapter.cpp b/src/app/calladapter.cpp index 43fbe76098e0a0fb5c7de9c3a65977a04d14d186..08d8ce0dc5f3c0fa45d8c4a973c2896b725d5fd2 100644 --- a/src/app/calladapter.cpp +++ b/src/app/calladapter.cpp @@ -739,7 +739,7 @@ CallAdapter::hangUpCall(const QString& callId) } void -CallAdapter::maximizeParticipant(const QString& uri) +CallAdapter::setActiveStream(const QString& uri, const QString& deviceId, const QString& streamId) { auto* callModel = lrcInstance_->getAccountInfo(accountId_).callModel.get(); const auto& convInfo @@ -755,15 +755,17 @@ CallAdapter::maximizeParticipant(const QString& uri) bool removeActive = false; for (auto part : participants) { auto participant = part.toJsonObject(); - auto isParticipant = participant[lrc::api::ParticipantsInfosStrings::URI].toString() - == uri; + + auto puri = participant[lrc::api::ParticipantsInfosStrings::URI].toString(); + auto pdeviceId = participant[lrc::api::ParticipantsInfosStrings::DEVICE].toString(); + auto pstreamId = participant[lrc::api::ParticipantsInfosStrings::STREAMID].toString(); + + auto isParticipant = puri == uri && pdeviceId == deviceId && pstreamId == streamId; auto active = participant[lrc::api::ParticipantsInfosStrings::ACTIVE].toBool(); - if (active && !isParticipant) { + if (active && !isParticipant) activeParticipants.push_back(participant); - } + if (isParticipant) { - auto deviceId = participant[lrc::api::ParticipantsInfosStrings::DEVICE].toString(); - auto streamId = participant[lrc::api::ParticipantsInfosStrings::STREAMID].toString(); // Else, continue. if (!active) { callModel->setActiveStream(confId, uri, deviceId, streamId, true); diff --git a/src/app/calladapter.h b/src/app/calladapter.h index c3f970067831aff58369a181e3a8a7b582e0792c..6770411f9f77b0f3a91e574b4e75f1b9304da6cc 100644 --- a/src/app/calladapter.h +++ b/src/app/calladapter.h @@ -60,7 +60,9 @@ public: // For Call Overlay Q_INVOKABLE void hangUpCall(const QString& callId); - Q_INVOKABLE void maximizeParticipant(const QString& uri); + Q_INVOKABLE void setActiveStream(const QString& uri, + const QString& deviceId, + const QString& streamId); Q_INVOKABLE void minimizeParticipant(const QString& uri); Q_INVOKABLE void showGridConferenceLayout(); Q_INVOKABLE void hangUpThisCall(); @@ -76,7 +78,10 @@ public: Q_INVOKABLE void muteCameraToggle(); Q_INVOKABLE bool isRecordingThisCall(); Q_INVOKABLE QVariantList getConferencesInfos() const; - Q_INVOKABLE void muteParticipant(const QString& accountUri, const QString& deviceId, const QString& sinkId, const bool state); + Q_INVOKABLE void muteParticipant(const QString& accountUri, + const QString& deviceId, + const QString& sinkId, + const bool state); Q_INVOKABLE MuteStates getMuteState(const QString& uri) const; Q_INVOKABLE void hangupParticipant(const QString& uri, const QString& deviceId); Q_INVOKABLE void updateCall(const QString& convUid = {}, diff --git a/src/app/mainview/components/ParticipantControlLayout.qml b/src/app/mainview/components/ParticipantControlLayout.qml index 057207e7e3df22285b6b58cdf113443a9d00d607..c6846fb3ac62a3eb774433c99064b3022858d79a 100644 --- a/src/app/mainview/components/ParticipantControlLayout.qml +++ b/src/app/mainview/components/ParticipantControlLayout.qml @@ -89,7 +89,7 @@ RowLayout { Layout.preferredWidth: buttonPreferredSize Layout.alignment: Qt.AlignVCenter source: JamiResources.open_in_full_24dp_svg - onClicked: CallAdapter.maximizeParticipant(uri) + onClicked: CallAdapter.setActiveStream(uri, deviceId, sinkId) toolTipText: JamiStrings.maximizeParticipant }