Add "premium_download_speedup" and "premium_upload_speedup" options.

This commit is contained in:
levlam 2024-04-08 19:18:21 +03:00
parent 62e4c3263f
commit 958ad4e4eb
3 changed files with 11 additions and 1 deletions

View File

@ -2042,6 +2042,14 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
G()->set_option_boolean("can_withdraw_chat_revenue", get_json_value_bool(std::move(key_value->value_), key));
continue;
}
if (key == "upload_premium_speedup_download") {
G()->set_option_integer("premium_download_speedup", get_json_value_int(std::move(key_value->value_), key));
continue;
}
if (key == "upload_premium_speedup_upload") {
G()->set_option_integer("premium_upload_speedup", get_json_value_int(std::move(key_value->value_), key));
continue;
}
new_values.push_back(std::move(key_value));
}

View File

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

View File

@ -145,6 +145,8 @@ OptionManager::OptionManager(Td *td)
set_default_integer_option("quick_reply_shortcut_message_count_max", 20);
set_default_integer_option("business_start_page_title_length_max", 32);
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);
if (options.isset("my_phone_number") || !options.isset("my_id")) {
update_premium_options();