Fix rerun flag not being unset after stream finishes (#5237)

This commit is contained in:
Mm2PL
2024-03-09 11:22:23 +01:00
committed by GitHub
parent 9151446c0e
commit 8cea86cf17
5 changed files with 32 additions and 1 deletions
+1 -1
View File
@@ -35,7 +35,7 @@
- Minor: Add a new Channel API for experimental plugins feature. (#5141, #5184, #5187) - Minor: Add a new Channel API for experimental plugins feature. (#5141, #5184, #5187)
- Minor: Added the ability to change the top-most status of a window regardless of the _Always on top_ setting (right click the notebook). (#5135) - Minor: Added the ability to change the top-most status of a window regardless of the _Always on top_ setting (right click the notebook). (#5135)
- Minor: Introduce `c2.later()` function to Lua API. (#5154) - Minor: Introduce `c2.later()` function to Lua API. (#5154)
- Minor: Live streams that are marked as reruns now mark a tab as yellow instead of red. (#5176) - Minor: Live streams that are marked as reruns now mark a tab as yellow instead of red. (#5176, #5237)
- Minor: Updated to Emoji v15.1. Google emojis are now used as the fallback instead of Twitter emojis. (#5182) - Minor: Updated to Emoji v15.1. Google emojis are now used as the fallback instead of Twitter emojis. (#5182)
- Minor: Allow theming of tab live and rerun indicators. (#5188) - Minor: Allow theming of tab live and rerun indicators. (#5188)
- Minor: Added a fallback theme field to custom themes that will be used in case the custom theme does not contain a color Chatterino needs. If no fallback theme is specified, we'll pull the color from the included Dark or Light theme. (#5198) - Minor: Added a fallback theme field to custom themes that will be used in case the custom theme does not contain a color Chatterino needs. If no fallback theme is specified, we'll pull the color from the included Dark or Light theme. (#5198)
@@ -384,6 +384,8 @@ void CommandController::initialize(Settings &, const Paths &paths)
#ifndef NDEBUG #ifndef NDEBUG
this->registerCommand("/fakemsg", &commands::injectFakeMessage); this->registerCommand("/fakemsg", &commands::injectFakeMessage);
this->registerCommand("/debug-update-to-no-stream",
&commands::injectStreamUpdateNoStream);
#endif #endif
this->registerCommand("/copy", &commands::copyToClipboard); this->registerCommand("/copy", &commands::copyToClipboard);
+23
View File
@@ -29,6 +29,8 @@
#include <QString> #include <QString>
#include <QUrl> #include <QUrl>
#include <optional>
namespace chatterino::commands { namespace chatterino::commands {
QString follow(const CommandContext &ctx) QString follow(const CommandContext &ctx)
@@ -569,6 +571,27 @@ QString injectFakeMessage(const CommandContext &ctx)
return ""; return "";
} }
QString injectStreamUpdateNoStream(const CommandContext &ctx)
{
/**
* /debug-update-to-no-stream makes the current channel mimic going offline
*/
if (ctx.channel == nullptr)
{
return "";
}
if (ctx.twitchChannel == nullptr)
{
ctx.channel->addMessage(
makeSystemMessage("The /debug-update-to-no-stream command only "
"works in Twitch channels"));
return "";
}
ctx.twitchChannel->updateStreamStatus(std::nullopt);
return "";
}
QString copyToClipboard(const CommandContext &ctx) QString copyToClipboard(const CommandContext &ctx)
{ {
if (ctx.channel == nullptr) if (ctx.channel == nullptr)
@@ -25,6 +25,7 @@ QString clearmessages(const CommandContext &ctx);
QString openURL(const CommandContext &ctx); QString openURL(const CommandContext &ctx);
QString sendRawMessage(const CommandContext &ctx); QString sendRawMessage(const CommandContext &ctx);
QString injectFakeMessage(const CommandContext &ctx); QString injectFakeMessage(const CommandContext &ctx);
QString injectStreamUpdateNoStream(const CommandContext &ctx);
QString copyToClipboard(const CommandContext &ctx); QString copyToClipboard(const CommandContext &ctx);
QString unstableSetUserClientSideColor(const CommandContext &ctx); QString unstableSetUserClientSideColor(const CommandContext &ctx);
QString openUsercard(const CommandContext &ctx); QString openUsercard(const CommandContext &ctx);
+5
View File
@@ -1178,6 +1178,11 @@ bool TwitchChannel::setLive(bool newLiveStatus)
return false; return false;
} }
guard->live = newLiveStatus; guard->live = newLiveStatus;
if (!newLiveStatus)
{
// A rerun is just a fancy livestream
guard->rerun = false;
}
return true; return true;
} }