From 491b6db72f9903e56829ae77b6846b35a50e219d Mon Sep 17 00:00:00 2001 From: nerix Date: Sat, 25 May 2024 13:12:04 +0200 Subject: [PATCH] chore: remove unused timegates (#5361) --- CHANGELOG.md | 1 + src/providers/twitch/IrcMessageHandler.cpp | 15 +--- src/singletons/Settings.hpp | 36 --------- src/widgets/settingspages/GeneralPage.cpp | 90 ---------------------- 4 files changed, 3 insertions(+), 139 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c85db1b..93dcf2ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Dev: Make printing of strings in tests easier. (#5379) - Dev: Refactor and document `Scrollbar`. (#5334, #5393) - Dev: Reduced the amount of scale events. (#5404, #5406) +- Dev: Removed unused timegate settings. (#5361) - Dev: All Lua globals now show in the `c2` global in the LuaLS metadata. (#5385) ## 2.5.1 diff --git a/src/providers/twitch/IrcMessageHandler.cpp b/src/providers/twitch/IrcMessageHandler.cpp index 21a52ef1..9dd2d7a4 100644 --- a/src/providers/twitch/IrcMessageHandler.cpp +++ b/src/providers/twitch/IrcMessageHandler.cpp @@ -435,19 +435,8 @@ std::vector parseNoticeMessage(Communi::IrcNoticeMessage *message) // default case std::vector builtMessages; - auto content = message->content(); - if (content.startsWith( - "Your settings prevent you from sending this whisper", - Qt::CaseInsensitive) && - getSettings()->helixTimegateWhisper.getValue() == - HelixTimegateOverride::Timegate) - { - content = content + - " Consider setting \"Helix timegate /w behaviour\" " - "to \"Always use Helix\" in your Chatterino settings."; - } - builtMessages.emplace_back( - makeSystemMessage(content, calculateMessageTime(message).time())); + builtMessages.emplace_back(makeSystemMessage( + message->content(), calculateMessageTime(message).time())); return builtMessages; } diff --git a/src/singletons/Settings.hpp b/src/singletons/Settings.hpp index 660b3c14..f0c19edf 100644 --- a/src/singletons/Settings.hpp +++ b/src/singletons/Settings.hpp @@ -47,19 +47,6 @@ enum UsernameDisplayMode : int { UsernameAndLocalizedName = 3, // Username (Localized name) }; -enum HelixTimegateOverride : int { - // Use the default timegated behaviour - // This means we use the old IRC command up until the migration date and - // switch over to the Helix API only after the migration date - Timegate = 1, - - // Ignore timegating and always force use the IRC command - AlwaysUseIRC = 2, - - // Ignore timegating and always force use the Helix API - AlwaysUseHelix = 3, -}; - enum ThumbnailPreviewMode : int { DontShow = 0, @@ -538,29 +525,6 @@ public: 1000, }; - // Temporary time-gate-overrides - EnumSetting helixTimegateRaid = { - "/misc/twitch/helix-timegate/raid", - HelixTimegateOverride::Timegate, - }; - EnumSetting helixTimegateWhisper = { - "/misc/twitch/helix-timegate/whisper", - HelixTimegateOverride::Timegate, - }; - EnumSetting helixTimegateVIPs = { - "/misc/twitch/helix-timegate/vips", - HelixTimegateOverride::Timegate, - }; - EnumSetting helixTimegateModerators = { - "/misc/twitch/helix-timegate/moderators", - HelixTimegateOverride::Timegate, - }; - - EnumSetting helixTimegateCommercial = { - "/misc/twitch/helix-timegate/commercial", - HelixTimegateOverride::Timegate, - }; - EnumStringSetting chatSendProtocol = { "/misc/chatSendProtocol", ChatSendProtocol::Default}; diff --git a/src/widgets/settingspages/GeneralPage.cpp b/src/widgets/settingspages/GeneralPage.cpp index d129e46e..e21e9809 100644 --- a/src/widgets/settingspages/GeneralPage.cpp +++ b/src/widgets/settingspages/GeneralPage.cpp @@ -1161,96 +1161,6 @@ void GeneralPage::initLayout(GeneralPageView &layout) "@mention for the related thread. If the reply context is hidden, " "these mentions will never be stripped."); - // Helix timegate settings - auto helixTimegateGetValue = [](auto val) { - switch (val) - { - case HelixTimegateOverride::Timegate: - return "Timegate"; - case HelixTimegateOverride::AlwaysUseIRC: - return "Always use IRC"; - case HelixTimegateOverride::AlwaysUseHelix: - return "Always use Helix"; - default: - return "Timegate"; - } - }; - - auto helixTimegateSetValue = [](auto args) { - const auto &v = args.value; - if (v == "Timegate") - { - return HelixTimegateOverride::Timegate; - } - if (v == "Always use IRC") - { - return HelixTimegateOverride::AlwaysUseIRC; - } - if (v == "Always use Helix") - { - return HelixTimegateOverride::AlwaysUseHelix; - } - - qCDebug(chatterinoSettings) << "Unknown Helix timegate override value" - << v << ", using default value Timegate"; - return HelixTimegateOverride::Timegate; - }; - - auto *helixTimegateRaid = - layout.addDropdown::type>( - "Helix timegate /raid behaviour", - {"Timegate", "Always use IRC", "Always use Helix"}, - s.helixTimegateRaid, - helixTimegateGetValue, // - helixTimegateSetValue, // - false); - helixTimegateRaid->setMinimumWidth( - helixTimegateRaid->minimumSizeHint().width()); - - auto *helixTimegateWhisper = - layout.addDropdown::type>( - "Helix timegate /w behaviour", - {"Timegate", "Always use IRC", "Always use Helix"}, - s.helixTimegateWhisper, - helixTimegateGetValue, // - helixTimegateSetValue, // - false); - helixTimegateWhisper->setMinimumWidth( - helixTimegateWhisper->minimumSizeHint().width()); - - auto *helixTimegateVIPs = - layout.addDropdown::type>( - "Helix timegate /vips behaviour", - {"Timegate", "Always use IRC", "Always use Helix"}, - s.helixTimegateVIPs, - helixTimegateGetValue, // - helixTimegateSetValue, // - false); - helixTimegateVIPs->setMinimumWidth( - helixTimegateVIPs->minimumSizeHint().width()); - - auto *helixTimegateCommercial = - layout.addDropdown::type>( - "Helix timegate /commercial behaviour", - {"Timegate", "Always use IRC", "Always use Helix"}, - s.helixTimegateCommercial, - helixTimegateGetValue, // - helixTimegateSetValue, // - false); - helixTimegateCommercial->setMinimumWidth( - helixTimegateCommercial->minimumSizeHint().width()); - - auto *helixTimegateModerators = - layout.addDropdown::type>( - "Helix timegate /mods behaviour", - {"Timegate", "Always use IRC", "Always use Helix"}, - s.helixTimegateModerators, - helixTimegateGetValue, // - helixTimegateSetValue, // - false); - helixTimegateModerators->setMinimumWidth( - helixTimegateModerators->minimumSizeHint().width()); - layout.addDropdownEnumClass( "Chat send protocol", qmagicenum::enumNames(), s.chatSendProtocol,