Make Twitch message history loading optional (On by default)

This commit is contained in:
Rasmus Karlsson 2019-05-25 11:24:10 +02:00
parent 79e4e05a4a
commit e1483bfd8a
3 changed files with 12 additions and 2 deletions

View file

@ -602,6 +602,11 @@ Outcome TwitchChannel::parseLiveStatus(const rapidjson::Document &document)
void TwitchChannel::loadRecentMessages() void TwitchChannel::loadRecentMessages()
{ {
if (!getSettings()->loadTwitchMessageHistoryOnConnect)
{
return;
}
static QString genericURL = [] { static QString genericURL = [] {
QString url("https://recent-messages.robotty.de/api/v2/recent-messages/" QString url("https://recent-messages.robotty.de/api/v2/recent-messages/"
"%1?clearchatToNotice=true"); "%1?clearchatToNotice=true");

View file

@ -39,7 +39,8 @@ public:
false}; false};
BoolSetting compactEmotes = {"/appearance/messages/compactEmotes", true}; BoolSetting compactEmotes = {"/appearance/messages/compactEmotes", true};
BoolSetting hideModerated = {"/appearance/messages/hideModerated", false}; BoolSetting hideModerated = {"/appearance/messages/hideModerated", false};
BoolSetting hideModerationActions = {"/appearance/messages/hideModerationActions", false}; BoolSetting hideModerationActions = {
"/appearance/messages/hideModerationActions", false};
// BoolSetting collapseLongMessages = // BoolSetting collapseLongMessages =
// {"/appearance/messages/collapseLongMessages", false}; // {"/appearance/messages/collapseLongMessages", false};
@ -189,6 +190,8 @@ public:
/// Misc /// Misc
IntSetting startUpNotification = {"/misc/startUpNotification", 0}; IntSetting startUpNotification = {"/misc/startUpNotification", 0};
QStringSetting currentVersion = {"/misc/currentVersion", ""}; QStringSetting currentVersion = {"/misc/currentVersion", ""};
BoolSetting loadTwitchMessageHistoryOnConnect = {
"/misc/twitch/loadMessageHistoryOnConnect", true};
QStringSetting cachePath = {"/cache/path", ""}; QStringSetting cachePath = {"/cache/path", ""};

View file

@ -274,8 +274,10 @@ void GeneralPage::initLayout(SettingsLayout &layout)
layout.addSpacing(16); layout.addSpacing(16);
layout.addSeperator(); layout.addSeperator();
layout.addTitle2("Misc"); layout.addTitle2("Miscellaneous (Twitch)");
layout.addCheckbox("Show twitch whispers inline", s.inlineWhispers); layout.addCheckbox("Show twitch whispers inline", s.inlineWhispers);
layout.addCheckbox("Load message history on connect",
s.loadTwitchMessageHistoryOnConnect);
/* /*
layout.addTitle2("Cache"); layout.addTitle2("Cache");