feat: delete messages from context menu (#5956)

This commit is contained in:
nerix
2025-02-15 19:29:25 +01:00
committed by GitHub
parent 9afd60534a
commit dd6f204adc
8 changed files with 89 additions and 55 deletions
+12
View File
@@ -2570,6 +2570,18 @@ void ChannelView::addMessageContextMenuItems(QMenu *menu,
}
}
auto *twitchChannel =
dynamic_cast<TwitchChannel *>(this->underlyingChannel_.get());
if (!layout->getMessage()->id.isEmpty() && twitchChannel &&
twitchChannel->hasModRights())
{
menu->addAction(
"&Delete message", [twitchChannel, id = layout->getMessage()->id] {
twitchChannel->deleteMessagesAs(
id, getApp()->getAccounts()->twitch.getCurrent().get());
});
}
bool isSearch = this->context_ == Context::Search;
bool isReplyOrUserCard = (this->context_ == Context::ReplyThread ||
this->context_ == Context::UserCard) &&