From 8460b1fe51f933d75313c259988d1b9e6d23b9c5 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 14 Jun 2024 18:21:46 +0300 Subject: [PATCH] Add "star_withdrawal_count_min" option. --- td/generate/scheme/td_api.tl | 2 +- td/telegram/ConfigManager.cpp | 7 +++++-- td/telegram/ConfigManager.h | 2 +- td/telegram/OptionManager.cpp | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 37e95c238..0fd9fa419 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -10734,7 +10734,7 @@ getStarRevenueStatistics owner_id:MessageSender is_dark:Bool = StarRevenueStatis //@description Returns URL for Telegram star withdrawal //@owner_id Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_revenue_statistics == true -//@star_count The number of Telegram stars to withdraw +//@star_count The number of Telegram stars to withdraw. Must be at least getOption("star_withdrawal_count_min") //@password The 2-step verification password of the current user getStarWithdrawalUrl owner_id:MessageSender star_count:int53 password:string = HttpUrl; diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index 85e8af650..d5ea94b42 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -2002,8 +2002,11 @@ void ConfigManager::process_app_config(tl_object_ptr &c continue; } if (key == "factcheck_length_limit") { - G()->set_option_integer("fact_check_length_max", - get_json_value_int(std::move(key_value->value_), key)); + G()->set_option_integer("fact_check_length_max", get_json_value_int(std::move(key_value->value_), key)); + continue; + } + if (key == "stars_revenue_withdrawal_min") { + G()->set_option_integer("star_withdrawal_count_min", get_json_value_int(std::move(key_value->value_), key)); continue; } diff --git a/td/telegram/ConfigManager.h b/td/telegram/ConfigManager.h index 0acfb299f..f6b21d9ea 100644 --- a/td/telegram/ConfigManager.h +++ b/td/telegram/ConfigManager.h @@ -85,7 +85,7 @@ class ConfigManager final : public NetQueryCallback { private: struct AppConfig { - static constexpr int32 CURRENT_VERSION = 46; + static constexpr int32 CURRENT_VERSION = 47; int32 version_ = 0; int32 hash_ = 0; telegram_api::object_ptr config_; diff --git a/td/telegram/OptionManager.cpp b/td/telegram/OptionManager.cpp index cf5dd0d4a..89afb458a 100644 --- a/td/telegram/OptionManager.cpp +++ b/td/telegram/OptionManager.cpp @@ -151,6 +151,7 @@ OptionManager::OptionManager(Td *td) set_default_integer_option("business_chat_link_count_max", is_test_dc ? 5 : 100); set_default_integer_option("pinned_story_count_max", 3); set_default_integer_option("fact_check_length_max", 1024); + set_default_integer_option("star_withdrawal_count_min", is_test_dc ? 10 : 1000); if (options.isset("my_phone_number") || !options.isset("my_id")) { update_premium_options();