From d03e103403556cb1c4113d0193a40db179a53908 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Sat, 24 Jan 2026 11:27:18 +0100 Subject: [PATCH] feat: add split action to clear `/watching` (#6759) Reviewed-by: pajlada --- CHANGELOG.md | 1 + .../commands/builtin/chatterino/Debugging.cpp | 13 +++++++++++++ src/widgets/splits/SplitHeader.cpp | 16 ++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bdf9a1b..578b76aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/controllers/commands/builtin/chatterino/Debugging.cpp b/src/controllers/commands/builtin/chatterino/Debugging.cpp index e331cec3..93c9708d 100644 --- a/src/controllers/commands/builtin/chatterino/Debugging.cpp +++ b/src/controllers/commands/builtin/chatterino/Debugging.cpp @@ -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( diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index 0d5b012a..9078567d 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -486,6 +486,22 @@ std::unique_ptr 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(); }