feat: add split action to clear /watching (#6759)
Reviewed-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
- Minor: Added Markdown support to user notes. (#6490)
|
||||
- Minor: Moderators and VIPs in shared chats now show their channel badges. (#6653)
|
||||
- Minor: Added message read/update methods to the `Channel` plugin API. (#6650)
|
||||
- Minor: Added action to reset `/watching`. (#6759)
|
||||
- Bugfix: Moderation checks now include the lead moderator badge. (#6642)
|
||||
- Bugfix: Fixed lead moderator badges not being filtered by the `Channel` badge setting. (#6665)
|
||||
- Bugfix: Expose the "Extra extension IDs" setting on non-Windows systems too. (#6509)
|
||||
|
||||
@@ -224,6 +224,19 @@ QString debugTest(const CommandContext &ctx)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (command == "set-watching")
|
||||
{
|
||||
if (ctx.words.size() < 3)
|
||||
{
|
||||
ctx.channel->addSystemMessage("Missing name");
|
||||
return {};
|
||||
}
|
||||
auto chan = getApp()->getTwitch()->getOrAddChannel(ctx.words.at(2));
|
||||
if (chan != getApp()->getTwitch()->getWatchingChannel().get())
|
||||
{
|
||||
getApp()->getTwitch()->setWatchingChannel(chan);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ctx.channel->addSystemMessage(
|
||||
|
||||
@@ -486,6 +486,22 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
|
||||
})
|
||||
->setVisible(twitchChannel->isLive());
|
||||
|
||||
if (this->split_->getIndirectChannel().getType() ==
|
||||
Channel::Type::TwitchWatching)
|
||||
{
|
||||
menu->addAction("Reset /watching", this->split_, [] {
|
||||
if (!getApp()
|
||||
->getTwitch()
|
||||
->getWatchingChannel()
|
||||
.get()
|
||||
->isEmpty())
|
||||
{
|
||||
getApp()->getTwitch()->setWatchingChannel(
|
||||
Channel::getEmpty());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
menu->addSeparator();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user