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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 32 additions and 1 deletions

View file

@ -35,7 +35,7 @@
- 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: 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: 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)

View file

@ -384,6 +384,8 @@ void CommandController::initialize(Settings &, const Paths &paths)
#ifndef NDEBUG
this->registerCommand("/fakemsg", &commands::injectFakeMessage);
this->registerCommand("/debug-update-to-no-stream",
&commands::injectStreamUpdateNoStream);
#endif
this->registerCommand("/copy", &commands::copyToClipboard);

View file

@ -29,6 +29,8 @@
#include <QString>
#include <QUrl>
#include <optional>
namespace chatterino::commands {
QString follow(const CommandContext &ctx)
@ -569,6 +571,27 @@ QString injectFakeMessage(const CommandContext &ctx)
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)
{
if (ctx.channel == nullptr)

View file

@ -25,6 +25,7 @@ QString clearmessages(const CommandContext &ctx);
QString openURL(const CommandContext &ctx);
QString sendRawMessage(const CommandContext &ctx);
QString injectFakeMessage(const CommandContext &ctx);
QString injectStreamUpdateNoStream(const CommandContext &ctx);
QString copyToClipboard(const CommandContext &ctx);
QString unstableSetUserClientSideColor(const CommandContext &ctx);
QString openUsercard(const CommandContext &ctx);

View file

@ -1178,6 +1178,11 @@ bool TwitchChannel::setLive(bool newLiveStatus)
return false;
}
guard->live = newLiveStatus;
if (!newLiveStatus)
{
// A rerun is just a fancy livestream
guard->rerun = false;
}
return true;
}