mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-07-14 04:25:22 +02:00
conference: add kick participant for moderator
Change-Id: Ife3de2e6174a9914fe4f164b8ac5a0bf653f0656
This commit is contained in:
parent
0fa4fe6fe4
commit
c353360ee2
3 changed files with 15 additions and 25 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue