diff options
| author | levlam <levlam@telegram.org> | 2026-06-24 20:23:41 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2026-06-24 20:23:41 +0300 |
| commit | 3f96d388814cd3323aece7d6fce2bcc2ae24478f (patch) | |
| tree | b0e235b11f972db69d0a489f5b49126b7b2d8a85 | |
| parent | 7c9b184a89b2a88ea19a93411a043b59a92dbee0 (diff) | |
Rename toncoin to gram in option names.
| -rw-r--r-- | td/generate/scheme/td_api.tl | 4 | ||||
| -rw-r--r-- | td/telegram/ConfigManager.cpp | 16 | ||||
| -rw-r--r-- | td/telegram/OptionManager.cpp | 22 | ||||
| -rw-r--r-- | td/telegram/StarGiftResalePrice.cpp | 4 | ||||
| -rw-r--r-- | td/telegram/SuggestedPostPrice.cpp | 4 |
5 files changed, 29 insertions, 21 deletions
diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index c0da47d1b..5b9e316cb 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1152,7 +1152,7 @@ giftResalePriceStar star_count:int53 = GiftResalePrice; //@description Describes price of a resold gift in TON Grams //@gram_cent_count The amount of 1/100 of Gram expected to be paid for the gift. Must be in the range -//-getOption("gift_resale_toncoin_cent_count_min")-getOption("gift_resale_toncoin_cent_count_max") +//-getOption("gift_resale_gram_cent_count_min")-getOption("gift_resale_gram_cent_count_max") giftResalePriceGram gram_cent_count:int53 = GiftResalePrice; @@ -1175,7 +1175,7 @@ giftPurchaseOfferStateRejected = GiftPurchaseOfferState; suggestedPostPriceStar star_count:int53 = SuggestedPostPrice; //@description Describes price of a suggested post in TON Grams -//@gram_cent_count The amount of 1/100 of Gram expected to be paid for the post; getOption("suggested_post_toncoin_cent_count_min")-getOption("suggested_post_toncoin_cent_count_max") +//@gram_cent_count The amount of 1/100 of Gram expected to be paid for the post; getOption("suggested_post_gram_cent_count_min")-getOption("suggested_post_gram_cent_count_max") suggestedPostPriceGram gram_cent_count:int53 = SuggestedPostPrice; diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index db16051a6..f0dfc2184 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -1476,8 +1476,8 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c {"todo_item_length_max", "checklist_task_text_length_max"}, {"todo_items_max", "checklist_task_count_max"}, {"todo_title_length_max", "checklist_title_length_max"}, - {"ton_stargift_resale_commission_permille", "gift_resale_toncoin_earnings_per_mille"}, - {"ton_suggested_post_commission_permille", "suggested_post_toncoin_earnings_per_mille"}, + {"ton_stargift_resale_commission_permille", "gift_resale_gram_earnings_per_mille"}, + {"ton_suggested_post_commission_permille", "suggested_post_gram_earnings_per_mille"}, {"topics_pinned_limit", "pinned_forum_topic_count_max"}, {"upload_premium_speedup_download", "premium_download_speedup"}, {"upload_premium_speedup_notify_period", ""}, @@ -1495,7 +1495,7 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c {"stories_venue_search_username", "venue_search_bot_username"}, {"ton_blockchain_explorer_url", ""}, {"ton_proxy_address", ""}, - {"ton_topup_url", "toncoin_top_up_url"}, + {"ton_topup_url", "gram_top_up_url"}, {"weather_search_username", "weather_bot_username"}}; static const FlatHashSet<Slice, SliceHash> ignored_options( {"channel_color_level_min", "default_emoji_statuses_stickerset_id", "dialog_filters_enabled", @@ -1911,27 +1911,27 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c continue; } if (key == "ton_suggested_post_amount_min") { - G()->set_option_integer("suggested_post_toncoin_cent_count_min", + G()->set_option_integer("suggested_post_gram_cent_count_min", get_json_value_long(std::move(key_value->value_), key) / 10000000); continue; } if (key == "ton_suggested_post_amount_max") { - G()->set_option_integer("suggested_post_toncoin_cent_count_max", + G()->set_option_integer("suggested_post_gram_cent_count_max", get_json_value_long(std::move(key_value->value_), key) / 10000000); continue; } if (key == "ton_stargift_resale_amount_min") { - G()->set_option_integer("gift_resale_toncoin_cent_count_min", + G()->set_option_integer("gift_resale_gram_cent_count_min", get_json_value_long(std::move(key_value->value_), key) / 10000000); continue; } if (key == "ton_stargift_resale_amount_max") { - G()->set_option_integer("gift_resale_toncoin_cent_count_max", + G()->set_option_integer("gift_resale_gram_cent_count_max", get_json_value_long(std::move(key_value->value_), key) / 10000000); continue; } if (key == "ton_usd_rate") { - G()->set_option_integer("million_toncoin_to_usd_rate", + G()->set_option_integer("million_gram_to_usd_rate", static_cast<int64>(get_json_value_double(std::move(key_value->value_), key) * 1000000)); continue; } diff --git a/td/telegram/OptionManager.cpp b/td/telegram/OptionManager.cpp index 13516b4e3..a83164e4d 100644 --- a/td/telegram/OptionManager.cpp +++ b/td/telegram/OptionManager.cpp @@ -184,20 +184,20 @@ OptionManager::OptionManager(Td *td) set_default_integer_option("checklist_task_count_max", is_test_dc ? 10 : 30); set_default_integer_option("suggested_post_star_count_min", 5); set_default_integer_option("suggested_post_star_count_max", 100000); - set_default_integer_option("suggested_post_toncoin_cent_count_min", 1); - set_default_integer_option("suggested_post_toncoin_cent_count_max", 1000000); + set_default_integer_option("suggested_post_gram_cent_count_min", 1); + set_default_integer_option("suggested_post_gram_cent_count_max", 1000000); set_default_integer_option("suggested_post_star_earnings_per_mille", 850); - set_default_integer_option("suggested_post_toncoin_earnings_per_mille", 850); - set_default_integer_option("million_toncoin_to_usd_rate", 3000000); + set_default_integer_option("suggested_post_gram_earnings_per_mille", 850); + set_default_integer_option("million_gram_to_usd_rate", 3000000); set_default_integer_option("suggested_post_lifetime_min", is_test_dc ? 120 : 86400); set_default_integer_option("suggested_post_send_delay_min", 300); set_default_integer_option("suggested_post_send_delay_max", 2678400); set_default_integer_option("star_withdrawal_count_max", is_test_dc ? 100 : 25000000); set_default_integer_option("gift_collection_count_max", 10); set_default_integer_option("gift_collection_size_max", 500); - set_default_integer_option("gift_resale_toncoin_cent_count_min", is_test_dc ? 5000 : 700); - set_default_integer_option("gift_resale_toncoin_cent_count_max", 10000000); - set_default_integer_option("gift_resale_toncoin_earnings_per_mille", 900); + set_default_integer_option("gift_resale_gram_cent_count_min", is_test_dc ? 5000 : 700); + set_default_integer_option("gift_resale_gram_cent_count_max", 10000000); + set_default_integer_option("gift_resale_gram_earnings_per_mille", 900); set_default_integer_option("story_album_count_max", is_test_dc ? 20 : 100); set_default_integer_option("story_album_size_max", is_test_dc ? 200 : 1000); set_default_integer_option("pending_text_message_period", 30); @@ -242,6 +242,14 @@ OptionManager::OptionManager(Td *td) set_option_empty("user_rating_learn_more_url"); set_option_empty("gift_collection_gift_count_max"); set_option_empty("story_album_story_count_max"); + set_option_empty("suggested_post_toncoin_cent_count_min"); + set_option_empty("suggested_post_toncoin_cent_count_max"); + set_option_empty("suggested_post_toncoin_earnings_per_mille"); + set_option_empty("million_toncoin_to_usd_rate"); + set_option_empty("gift_resale_toncoin_cent_count_min"); + set_option_empty("gift_resale_toncoin_cent_count_max"); + set_option_empty("gift_resale_toncoin_earnings_per_mille"); + set_option_empty("toncoin_top_up_url"); } OptionManager::~OptionManager() = default; diff --git a/td/telegram/StarGiftResalePrice.cpp b/td/telegram/StarGiftResalePrice.cpp index 995841147..c12d5a16e 100644 --- a/td/telegram/StarGiftResalePrice.cpp +++ b/td/telegram/StarGiftResalePrice.cpp @@ -83,8 +83,8 @@ Result<StarGiftResalePrice> StarGiftResalePrice::get_star_gift_resale_price( return Status::Error(400, "Invalid amount of Grams specified"); } if (!is_purchase) { - if (amount < td->option_manager_->get_option_integer("gift_resale_toncoin_cent_count_min") || - amount > td->option_manager_->get_option_integer("gift_resale_toncoin_cent_count_max")) { + if (amount < td->option_manager_->get_option_integer("gift_resale_gram_cent_count_min") || + amount > td->option_manager_->get_option_integer("gift_resale_gram_cent_count_max")) { return Status::Error(400, "Invalid amount of Gram cents specified"); } } diff --git a/td/telegram/SuggestedPostPrice.cpp b/td/telegram/SuggestedPostPrice.cpp index e6c30151b..3cc23a802 100644 --- a/td/telegram/SuggestedPostPrice.cpp +++ b/td/telegram/SuggestedPostPrice.cpp @@ -76,8 +76,8 @@ Result<SuggestedPostPrice> SuggestedPostPrice::get_suggested_post_price( if (amount == 0) { return SuggestedPostPrice(); } - if (amount < td->option_manager_->get_option_integer("suggested_post_toncoin_cent_count_min") || - amount > td->option_manager_->get_option_integer("suggested_post_toncoin_cent_count_max")) { + if (amount < td->option_manager_->get_option_integer("suggested_post_gram_cent_count_min") || + amount > td->option_manager_->get_option_integer("suggested_post_gram_cent_count_max")) { return Status::Error(400, "Invalid amount of Gram cents specified"); } SuggestedPostPrice result; |
