Add internal "upload_premium_speedup_notify_period" option.

This commit is contained in:
levlam 2024-04-08 19:21:52 +03:00
parent 958ad4e4eb
commit 8b440b6761
3 changed files with 7 additions and 1 deletions

View File

@ -2050,6 +2050,10 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
G()->set_option_integer("premium_upload_speedup", get_json_value_int(std::move(key_value->value_), key)); G()->set_option_integer("premium_upload_speedup", get_json_value_int(std::move(key_value->value_), key));
continue; continue;
} }
if (key == "upload_premium_speedup_notify_period") {
G()->set_option_integer(key, get_json_value_int(std::move(key_value->value_), key));
continue;
}
new_values.push_back(std::move(key_value)); new_values.push_back(std::move(key_value));
} }

View File

@ -103,7 +103,7 @@ class ConfigManager final : public NetQueryCallback {
private: private:
struct AppConfig { struct AppConfig {
static constexpr int32 CURRENT_VERSION = 38; static constexpr int32 CURRENT_VERSION = 39;
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

@ -147,6 +147,7 @@ OptionManager::OptionManager(Td *td)
set_default_integer_option("business_start_page_message_length_max", 70); set_default_integer_option("business_start_page_message_length_max", 70);
set_default_integer_option("premium_download_speedup", 10); set_default_integer_option("premium_download_speedup", 10);
set_default_integer_option("premium_upload_speedup", 10); set_default_integer_option("premium_upload_speedup", 10);
set_default_integer_option("upload_premium_speedup_notify_period", 3600);
if (options.isset("my_phone_number") || !options.isset("my_id")) { if (options.isset("my_phone_number") || !options.isset("my_id")) {
update_premium_options(); update_premium_options();
@ -441,6 +442,7 @@ bool OptionManager::is_internal_option(Slice name) {
"story_caption_length_limit_premium", "story_caption_length_limit_premium",
"story_expiring_limit_default", "story_expiring_limit_default",
"story_expiring_limit_premium", "story_expiring_limit_premium",
"upload_premium_speedup_notify_period",
"video_note_size_max", "video_note_size_max",
"webfile_dc_id"}; "webfile_dc_id"};
return internal_options.count(name) > 0; return internal_options.count(name) > 0;