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
Loading
......@@ -723,8 +723,8 @@ CallAdapter::setModerator(const QString& uri, const bool state)
}
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* convModel = LRCInstance::getCurrentConversationModel();
const auto conversation = convModel->getConversationForUID(LRCInstance::getCurrentConvUid());
......@@ -760,29 +760,19 @@ CallAdapter::isMuted(const QString& uri) const
return false;
}
bool
CallAdapter::isCurrentMuted() const
void
CallAdapter::hangupParticipant(const QString& uri)
{
auto* callModel = LRCInstance::getAccountInfo(accountId_).callModel.get();
auto* convModel = LRCInstance::getCurrentConversationModel();
const auto convInfo = convModel->getConversationForUID(convUid_);
if (!convInfo.uid.isEmpty()) {
auto* callModel = LRCInstance::getAccountInfo(accountId_).callModel.get();
try {
auto call = callModel->getCall(convInfo.callId);
if (call.participantsInfos.size() == 0) {
return false;
} else {
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;
const auto conversation = convModel->getConversationForUID(LRCInstance::getCurrentConvUid());
auto confId = conversation.confId;
if (confId.isEmpty())
confId = conversation.callId;
try {
const auto call = callModel->getCall(confId);
callModel->hangupParticipant(confId, uri);
} catch (...) {}
}
void
......
......@@ -69,7 +69,7 @@ public:
Q_INVOKABLE QVariantList getConferencesInfos();
Q_INVOKABLE void muteParticipant(const QString& uri, const bool state);
Q_INVOKABLE bool isMuted(const QString& uri) const;
Q_INVOKABLE bool isCurrentMuted() const;
Q_INVOKABLE void hangupParticipant(const QString& uri);
signals:
void callStatusChanged(int index, const QString& accountId, const QString& convUid);
......
......@@ -249,7 +249,7 @@ Rectangle {
source: "qrc:/images/icons/ic_block_24px.svg"
imageColor: hovered? JamiTheme.darkGreyColor
: JamiTheme.whiteColor
onClicked: CallAdapter.hangupCall(uri)
onClicked: CallAdapter.hangupParticipant(uri)
onHoveredChanged: hangupParticipantToolTip.visible = hovered
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