Fix "story_caption_length_max" option.

This commit is contained in:
levlam 2023-07-21 16:33:39 +03:00
parent 5ee046b259
commit be9d779f5c
2 changed files with 1 additions and 8 deletions

View File

@ -1479,7 +1479,6 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
bool archive_all_stories = false;
int32 story_viewers_expire_period = 86400;
int64 stories_changelog_user_id = ContactsManager::get_service_notifications_user_id().get();
int32 story_caption_length_limit = 1024;
if (config->get_id() == telegram_api::jsonObject::ID) {
for (auto &key_value : static_cast<telegram_api::jsonObject *>(config.get())->value_) {
Slice key = key_value->key_;
@ -1884,10 +1883,6 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
stories_changelog_user_id = get_json_value_long(std::move(key_value->value_), key);
continue;
}
if (key == "story_caption_length_limit") {
story_caption_length_limit = get_json_value_int(std::move(key_value->value_), key);
continue;
}
new_values.push_back(std::move(key_value));
}
@ -2018,8 +2013,6 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
options.get_option_integer("chatlist_invites_limit_default", 2));
}
options.set_option_integer("story_caption_length_max", clamp(story_caption_length_limit, 1024, 1000000));
if (!is_premium_available) {
premium_bot_username.clear(); // just in case
premium_invoice_slug.clear(); // just in case

View File

@ -79,7 +79,7 @@ OptionManager::OptionManager(Td *td)
set_option_integer("message_caption_length_max", 1024);
}
if (!have_option("story_caption_length_max")) {
set_option_integer("story_caption_length_max", 1024);
set_option_integer("story_caption_length_max", 2048);
}
if (!have_option("bio_length_max")) {
set_option_integer("bio_length_max", 70);