Skip to content
Snippets Groups Projects
Commit c353360e authored by Pierre Lespagnol's avatar Pierre Lespagnol Committed by Albert Babí Oller
Browse files

conference: add kick participant for moderator

Change-Id: Ife3de2e6174a9914fe4f164b8ac5a0bf653f0656
parent 0fa4fe6f
No related branches found
No related tags found
No related merge requests found
...@@ -723,8 +723,8 @@ CallAdapter::setModerator(const QString& uri, const bool state) ...@@ -723,8 +723,8 @@ CallAdapter::setModerator(const QString& uri, const bool state)
} }
void void
CallAdapter::muteParticipant(const QString& uri, const bool state) { CallAdapter::muteParticipant(const QString& uri, const bool state)
{
auto* callModel = LRCInstance::getAccountInfo(accountId_).callModel.get(); auto* callModel = LRCInstance::getAccountInfo(accountId_).callModel.get();
auto* convModel = LRCInstance::getCurrentConversationModel(); auto* convModel = LRCInstance::getCurrentConversationModel();
const auto conversation = convModel->getConversationForUID(LRCInstance::getCurrentConvUid()); const auto conversation = convModel->getConversationForUID(LRCInstance::getCurrentConvUid());
...@@ -760,29 +760,19 @@ CallAdapter::isMuted(const QString& uri) const ...@@ -760,29 +760,19 @@ CallAdapter::isMuted(const QString& uri) const
return false; return false;
} }
bool void
CallAdapter::isCurrentMuted() const CallAdapter::hangupParticipant(const QString& uri)
{ {
auto* callModel = LRCInstance::getAccountInfo(accountId_).callModel.get();
auto* convModel = LRCInstance::getCurrentConversationModel(); auto* convModel = LRCInstance::getCurrentConversationModel();
const auto convInfo = convModel->getConversationForUID(convUid_); const auto conversation = convModel->getConversationForUID(LRCInstance::getCurrentConvUid());
if (!convInfo.uid.isEmpty()) { auto confId = conversation.confId;
auto* callModel = LRCInstance::getAccountInfo(accountId_).callModel.get(); if (confId.isEmpty())
try { confId = conversation.callId;
auto call = callModel->getCall(convInfo.callId); try {
if (call.participantsInfos.size() == 0) { const auto call = callModel->getCall(confId);
return false; callModel->hangupParticipant(confId, uri);
} else { } catch (...) {}
auto& accInfo = LRCInstance::accountModel().getAccountInfo(accountId_);
for (const auto& participant : call.participantsInfos) {
if (participant["uri"] == accInfo.profileInfo.uri)
return participant["audioMuted"] == "true";
}
}
return false;
} catch (...) {
}
}
return true;
} }
void void
......
...@@ -69,7 +69,7 @@ public: ...@@ -69,7 +69,7 @@ public:
Q_INVOKABLE QVariantList getConferencesInfos(); Q_INVOKABLE QVariantList getConferencesInfos();
Q_INVOKABLE void muteParticipant(const QString& uri, const bool state); Q_INVOKABLE void muteParticipant(const QString& uri, const bool state);
Q_INVOKABLE bool isMuted(const QString& uri) const; Q_INVOKABLE bool isMuted(const QString& uri) const;
Q_INVOKABLE bool isCurrentMuted() const; Q_INVOKABLE void hangupParticipant(const QString& uri);
signals: signals:
void callStatusChanged(int index, const QString& accountId, const QString& convUid); void callStatusChanged(int index, const QString& accountId, const QString& convUid);
......
...@@ -249,7 +249,7 @@ Rectangle { ...@@ -249,7 +249,7 @@ Rectangle {
source: "qrc:/images/icons/ic_block_24px.svg" source: "qrc:/images/icons/ic_block_24px.svg"
imageColor: hovered? JamiTheme.darkGreyColor imageColor: hovered? JamiTheme.darkGreyColor
: JamiTheme.whiteColor : JamiTheme.whiteColor
onClicked: CallAdapter.hangupCall(uri) onClicked: CallAdapter.hangupParticipant(uri)
onHoveredChanged: hangupParticipantToolTip.visible = hovered onHoveredChanged: hangupParticipantToolTip.visible = hovered
Text { Text {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment