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
@@ -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);
+23
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)
@@ -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);
+5
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;
}