From be9d779f5cc2d843f09944288d3c9357777f71cb Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 21 Jul 2023 16:33:39 +0300 Subject: [PATCH] Fix "story_caption_length_max" option. --- td/telegram/ConfigManager.cpp | 7 ------- td/telegram/OptionManager.cpp | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index 5a22f2a88..cc971993e 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -1479,7 +1479,6 @@ void ConfigManager::process_app_config(tl_object_ptr &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(config.get())->value_) { Slice key = key_value->key_; @@ -1884,10 +1883,6 @@ void ConfigManager::process_app_config(tl_object_ptr &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 &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 diff --git a/td/telegram/OptionManager.cpp b/td/telegram/OptionManager.cpp index 8fb621e17..8467ae807 100644 --- a/td/telegram/OptionManager.cpp +++ b/td/telegram/OptionManager.cpp @@ -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);