Add "story_link_area_count_max" option.

This commit is contained in:
levlam 2024-06-17 00:32:42 +03:00
parent 8def10793d
commit 5c06e873f3
4 changed files with 8 additions and 2 deletions

View File

@ -3944,7 +3944,8 @@ inputStoryArea position:storyAreaPosition type:InputStoryAreaType = InputStoryAr
//@description Contains a list of story areas to be added @areas List of input story areas. Currently, a story can have //@description Contains a list of story areas to be added @areas List of input story areas. Currently, a story can have
//-up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, //-up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas,
//-up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, //-up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas,
//-up to 1 inputStoryAreaTypeMessage area, and up to 3 inputStoryAreaTypeLink areas if the current user is a Telegram Premium user //-up to 1 inputStoryAreaTypeMessage area, and
//-up to getOption("story_link_area_count_max") inputStoryAreaTypeLink areas if the current user is a Telegram Premium user
inputStoryAreas areas:vector<inputStoryArea> = InputStoryAreas; inputStoryAreas areas:vector<inputStoryArea> = InputStoryAreas;

View File

@ -2009,6 +2009,10 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
G()->set_option_integer("star_withdrawal_count_min", get_json_value_int(std::move(key_value->value_), key)); G()->set_option_integer("star_withdrawal_count_min", get_json_value_int(std::move(key_value->value_), key));
continue; continue;
} }
if (key == "stories_area_url_max") {
G()->set_option_integer("story_link_area_count_max", get_json_value_int(std::move(key_value->value_), key));
continue;
}
new_values.push_back(std::move(key_value)); new_values.push_back(std::move(key_value));
} }

View File

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

View File

@ -152,6 +152,7 @@ OptionManager::OptionManager(Td *td)
set_default_integer_option("pinned_story_count_max", 3); set_default_integer_option("pinned_story_count_max", 3);
set_default_integer_option("fact_check_length_max", 1024); set_default_integer_option("fact_check_length_max", 1024);
set_default_integer_option("star_withdrawal_count_min", is_test_dc ? 10 : 1000); set_default_integer_option("star_withdrawal_count_min", is_test_dc ? 10 : 1000);
set_default_integer_option("story_link_area_count_max", 3);
if (options.isset("my_phone_number") || !options.isset("my_id")) { if (options.isset("my_phone_number") || !options.isset("my_id")) {
update_premium_options(); update_premium_options();