From 20a6b90904103478735f1c7780dfba0c96f0cfa2 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 22 Nov 2024 11:29:02 -0500 Subject: [PATCH] Add command to forcibly end a call in the room --- src/models/actionsmodel.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/models/actionsmodel.cpp b/src/models/actionsmodel.cpp index 877387031..0b7088f1c 100644 --- a/src/models/actionsmodel.cpp +++ b/src/models/actionsmodel.cpp @@ -505,6 +505,20 @@ QList actions{ kli18n(" []"), kli18n("Removes the user from the room"), }, + Action{ + QStringLiteral("endcall"), + [](const QString &text, NeoChatRoom *room, ChatBarCache *) { + auto events = room->currentState().eventsOfType(QStringLiteral("org.matrix.msc3401.call.member")); + for (auto event : events) { + room->setRoomState(QStringLiteral("org.matrix.msc3401.call.member"), event->stateKey(), {}); + } + return QString(); + }, + false, + std::nullopt, + kli18n(""), + kli18n("Forcibly end the call in this room"), + }, }; int ActionsModel::rowCount(const QModelIndex &parent) const