diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 7dca44ae9..7908fdd88 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -8344,7 +8344,7 @@ editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:Messa //@description Changes the fact-check of a message. Can be only used if getOption("can_edit_fact_check") == true //@chat_id The channel chat the message belongs to //@message_id Identifier of the message -//@text New text of the fact-check; 0-1024 characters; pass null to remove it. Only Bold, Italic, and TextUrl entities are supported +//@text New text of the fact-check; 0-getOption("fact_check_length_max") characters; pass null to remove it. Only Bold, Italic, and TextUrl entities are supported setMessageFactCheck chat_id:int53 message_id:int53 text:formattedText = Ok; diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index 57c84a695..85e8af650 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -2001,6 +2001,11 @@ void ConfigManager::process_app_config(tl_object_ptr &c can_edit_fact_check = get_json_value_bool(std::move(key_value->value_), key); continue; } + if (key == "factcheck_length_limit") { + G()->set_option_integer("fact_check_length_max", + get_json_value_int(std::move(key_value->value_), key)); + continue; + } new_values.push_back(std::move(key_value)); } diff --git a/td/telegram/ConfigManager.h b/td/telegram/ConfigManager.h index 2f7789542..0acfb299f 100644 --- a/td/telegram/ConfigManager.h +++ b/td/telegram/ConfigManager.h @@ -85,7 +85,7 @@ class ConfigManager final : public NetQueryCallback { private: struct AppConfig { - static constexpr int32 CURRENT_VERSION = 45; + static constexpr int32 CURRENT_VERSION = 46; int32 version_ = 0; int32 hash_ = 0; telegram_api::object_ptr config_; diff --git a/td/telegram/OptionManager.cpp b/td/telegram/OptionManager.cpp index 403a73cb5..6e1245da1 100644 --- a/td/telegram/OptionManager.cpp +++ b/td/telegram/OptionManager.cpp @@ -150,6 +150,7 @@ OptionManager::OptionManager(Td *td) set_default_integer_option("upload_premium_speedup_notify_period", 3600); set_default_integer_option("business_chat_link_count_max", is_test_dc ? 5 : 100); set_default_integer_option("pinned_story_count_max", 3); + set_default_integer_option("fact_check_length_max", 1024); if (options.isset("my_phone_number") || !options.isset("my_id")) { update_premium_options();