Add internal option "channel_restrict_sponsored_level_min".

This commit is contained in:
levlam 2024-04-02 14:36:38 +03:00
parent b987e84d54
commit 67d42c5e14
3 changed files with 8 additions and 5 deletions

View File

@ -1991,10 +1991,11 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
} }
if (key == "channel_bg_icon_level_min" || key == "channel_custom_wallpaper_level_min" || if (key == "channel_bg_icon_level_min" || key == "channel_custom_wallpaper_level_min" ||
key == "channel_emoji_status_level_min" || key == "channel_profile_bg_icon_level_min" || key == "channel_emoji_status_level_min" || key == "channel_profile_bg_icon_level_min" ||
key == "channel_wallpaper_level_min" || key == "pm_read_date_expire_period" || key == "channel_restrict_sponsored_level_min" || key == "channel_wallpaper_level_min" ||
key == "group_transcribe_level_min" || key == "group_emoji_stickers_level_min" || key == "pm_read_date_expire_period" || key == "group_transcribe_level_min" ||
key == "group_profile_bg_icon_level_min" || key == "group_emoji_status_level_min" || key == "group_emoji_stickers_level_min" || key == "group_profile_bg_icon_level_min" ||
key == "group_wallpaper_level_min" || key == "group_custom_wallpaper_level_min") { key == "group_emoji_status_level_min" || key == "group_wallpaper_level_min" ||
key == "group_custom_wallpaper_level_min") {
G()->set_option_integer(key, get_json_value_int(std::move(key_value->value_), key)); G()->set_option_integer(key, get_json_value_int(std::move(key_value->value_), key));
continue; continue;
} }

View File

@ -103,7 +103,7 @@ class ConfigManager final : public NetQueryCallback {
private: private:
struct AppConfig { struct AppConfig {
static constexpr int32 CURRENT_VERSION = 35; static constexpr int32 CURRENT_VERSION = 36;
int32 version_ = 0; int32 version_ = 0;
int32 hash_ = 0; int32 hash_ = 0;
telegram_api::object_ptr<telegram_api::JSONValue> config_; telegram_api::object_ptr<telegram_api::JSONValue> config_;

View File

@ -132,6 +132,7 @@ OptionManager::OptionManager(Td *td)
set_default_integer_option("channel_custom_wallpaper_level_min", is_test_dc ? 4 : 10); set_default_integer_option("channel_custom_wallpaper_level_min", is_test_dc ? 4 : 10);
set_default_integer_option("channel_emoji_status_level_min", is_test_dc ? 2 : 8); set_default_integer_option("channel_emoji_status_level_min", is_test_dc ? 2 : 8);
set_default_integer_option("channel_profile_bg_icon_level_min", is_test_dc ? 1 : 7); set_default_integer_option("channel_profile_bg_icon_level_min", is_test_dc ? 1 : 7);
set_default_integer_option("channel_restrict_sponsored_level_min", is_test_dc ? 5 : 50);
set_default_integer_option("channel_wallpaper_level_min", is_test_dc ? 3 : 9); set_default_integer_option("channel_wallpaper_level_min", is_test_dc ? 3 : 9);
set_default_integer_option("pm_read_date_expire_period", 604800); set_default_integer_option("pm_read_date_expire_period", 604800);
set_default_integer_option("group_transcribe_level_min", is_test_dc ? 4 : 6); set_default_integer_option("group_transcribe_level_min", is_test_dc ? 4 : 6);
@ -352,6 +353,7 @@ bool OptionManager::is_internal_option(Slice name) {
"channel_custom_wallpaper_level_min", "channel_custom_wallpaper_level_min",
"channel_emoji_status_level_min", "channel_emoji_status_level_min",
"channel_profile_bg_icon_level_min", "channel_profile_bg_icon_level_min",
"channel_restrict_sponsored_level_min",
"channel_wallpaper_level_min", "channel_wallpaper_level_min",
"channels_limit_default", "channels_limit_default",
"channels_limit_premium", "channels_limit_premium",