From 8b440b6761a441b6adefd45de2a5f0553e9fe759 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 8 Apr 2024 19:21:52 +0300 Subject: [PATCH] Add internal "upload_premium_speedup_notify_period" option. --- td/telegram/ConfigManager.cpp | 4 ++++ td/telegram/ConfigManager.h | 2 +- td/telegram/OptionManager.cpp | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index d861868e8..4a5b01c80 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -2050,6 +2050,10 @@ void ConfigManager::process_app_config(tl_object_ptr &c G()->set_option_integer("premium_upload_speedup", get_json_value_int(std::move(key_value->value_), key)); 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)); } diff --git a/td/telegram/ConfigManager.h b/td/telegram/ConfigManager.h index b65dcf925..80de3f5cc 100644 --- a/td/telegram/ConfigManager.h +++ b/td/telegram/ConfigManager.h @@ -103,7 +103,7 @@ class ConfigManager final : public NetQueryCallback { private: struct AppConfig { - static constexpr int32 CURRENT_VERSION = 38; + static constexpr int32 CURRENT_VERSION = 39; int32 version_ = 0; int32 hash_ = 0; telegram_api::object_ptr config_; diff --git a/td/telegram/OptionManager.cpp b/td/telegram/OptionManager.cpp index c53459213..3098d2b4f 100644 --- a/td/telegram/OptionManager.cpp +++ b/td/telegram/OptionManager.cpp @@ -147,6 +147,7 @@ OptionManager::OptionManager(Td *td) set_default_integer_option("business_start_page_message_length_max", 70); set_default_integer_option("premium_download_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")) { update_premium_options(); @@ -441,6 +442,7 @@ bool OptionManager::is_internal_option(Slice name) { "story_caption_length_limit_premium", "story_expiring_limit_default", "story_expiring_limit_premium", + "upload_premium_speedup_notify_period", "video_note_size_max", "webfile_dc_id"}; return internal_options.count(name) > 0;