chore: remove unused timegates (#5361)

This commit is contained in:
nerix 2024-05-25 13:12:04 +02:00 committed by GitHub
parent ec6b1ef24d
commit 491b6db72f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 3 additions and 139 deletions

View file

@ -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

View file

@ -435,19 +435,8 @@ std::vector<MessagePtr> parseNoticeMessage(Communi::IrcNoticeMessage *message)
// default case
std::vector<MessagePtr> 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;
}

View file

@ -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<HelixTimegateOverride> helixTimegateRaid = {
"/misc/twitch/helix-timegate/raid",
HelixTimegateOverride::Timegate,
};
EnumSetting<HelixTimegateOverride> helixTimegateWhisper = {
"/misc/twitch/helix-timegate/whisper",
HelixTimegateOverride::Timegate,
};
EnumSetting<HelixTimegateOverride> helixTimegateVIPs = {
"/misc/twitch/helix-timegate/vips",
HelixTimegateOverride::Timegate,
};
EnumSetting<HelixTimegateOverride> helixTimegateModerators = {
"/misc/twitch/helix-timegate/moderators",
HelixTimegateOverride::Timegate,
};
EnumSetting<HelixTimegateOverride> helixTimegateCommercial = {
"/misc/twitch/helix-timegate/commercial",
HelixTimegateOverride::Timegate,
};
EnumStringSetting<ChatSendProtocol> chatSendProtocol = {
"/misc/chatSendProtocol", ChatSendProtocol::Default};

View file

@ -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<std::underlying_type<HelixTimegateOverride>::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<std::underlying_type<HelixTimegateOverride>::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<std::underlying_type<HelixTimegateOverride>::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<std::underlying_type<HelixTimegateOverride>::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<std::underlying_type<HelixTimegateOverride>::type>(
"Helix timegate /mods behaviour",
{"Timegate", "Always use IRC", "Always use Helix"},
s.helixTimegateModerators,
helixTimegateGetValue, //
helixTimegateSetValue, //
false);
helixTimegateModerators->setMinimumWidth(
helixTimegateModerators->minimumSizeHint().width());
layout.addDropdownEnumClass<ChatSendProtocol>(
"Chat send protocol", qmagicenum::enumNames<ChatSendProtocol>(),
s.chatSendProtocol,