Skip to content

Commit

Permalink
Avoid digits in option names.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Aug 17, 2024
1 parent 1a901a0 commit 2684d8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions td/telegram/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2064,11 +2064,11 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
continue;
}
if (key == "stars_usd_sell_rate_x1000") {
G()->set_option_integer("usd_to_1000_star_rate", get_json_value_int(std::move(key_value->value_), key));
G()->set_option_integer("usd_to_thousand_star_rate", get_json_value_int(std::move(key_value->value_), key));
continue;
}
if (key == "stars_usd_withdraw_rate_x1000") {
G()->set_option_integer("1000_star_to_usd_rate", get_json_value_int(std::move(key_value->value_), key));
G()->set_option_integer("thousand_star_to_usd_rate", get_json_value_int(std::move(key_value->value_), key));
continue;
}

Expand Down
6 changes: 4 additions & 2 deletions td/telegram/OptionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ OptionManager::OptionManager(Td *td)
set_default_integer_option("bot_media_preview_count_max", 12);
set_default_integer_option("paid_reaction_star_count_max", 2500);
set_default_integer_option("subscription_star_count_max", 2500);
set_default_integer_option("usd_to_1000_star_rate", 1410);
set_default_integer_option("1000_star_to_usd_rate", 1200);
set_default_integer_option("usd_to_thousand_star_rate", 1410);
set_default_integer_option("thousand_star_to_usd_rate", 1200);

if (options.isset("my_phone_number") || !options.isset("my_id")) {
update_premium_options();
Expand All @@ -174,6 +174,8 @@ OptionManager::OptionManager(Td *td)
set_option_empty("forum_member_count_min");
set_option_empty("themed_emoji_statuses_sticker_set_id");
set_option_empty("themed_premium_statuses_sticker_set_id");
set_option_empty("usd_to_1000_star_rate");
set_option_empty("1000_star_to_usd_rate");
}

OptionManager::~OptionManager() = default;
Expand Down

0 comments on commit 2684d8e

Please sign in to comment.