From ea9e99407f8fa062de785ab4ee3fa5ae340ec68a Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 28 Nov 2023 14:31:43 +0300 Subject: [PATCH] Add "chat_boost_level_max" option. --- td/telegram/ConfigManager.cpp | 4 ++++ td/telegram/ConfigManager.h | 2 +- td/telegram/OptionManager.cpp | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index 1b785f3fb..6399f1f0a 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -1967,6 +1967,10 @@ void ConfigManager::process_app_config(tl_object_ptr &c transcribe_audio_trial_cooldown_until = get_json_value_int(std::move(key_value->value_), key); continue; } + if (key == "boosts_channel_level_max") { + G()->set_option_integer("chat_boost_level_max", max(0, get_json_value_int(std::move(key_value->value_), key))); + continue; + } new_values.push_back(std::move(key_value)); } diff --git a/td/telegram/ConfigManager.h b/td/telegram/ConfigManager.h index 03f4abfd3..864346074 100644 --- a/td/telegram/ConfigManager.h +++ b/td/telegram/ConfigManager.h @@ -102,7 +102,7 @@ class ConfigManager final : public NetQueryCallback { private: struct AppConfig { - static constexpr int32 CURRENT_VERSION = 25; + static constexpr int32 CURRENT_VERSION = 26; int32 version_ = 0; int32 hash_ = 0; telegram_api::object_ptr config_; diff --git a/td/telegram/OptionManager.cpp b/td/telegram/OptionManager.cpp index cab576d97..ef1ddf938 100644 --- a/td/telegram/OptionManager.cpp +++ b/td/telegram/OptionManager.cpp @@ -149,6 +149,9 @@ OptionManager::OptionManager(Td *td) if (!have_option("premium_gift_boost_count")) { set_option_integer("premium_gift_boost_count", 3); } + if (!have_option("chat_boost_level_max")) { + set_option_integer("chat_boost_level_max", G()->is_test_dc() ? 10 : 100); + } set_option_empty("archive_and_mute_new_chats_from_unknown_users"); set_option_empty("chat_filter_count_max");