From b20c77d4596e9ce831eaa3ed79ede1da690a8a92 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 27 Jun 2018 02:28:49 +0300 Subject: [PATCH] Add message_*_length_max options. GitOrigin-RevId: 27fc7c79b0820916daaf23745078a4204c3dc6c9 --- td/telegram/ConfigManager.cpp | 3 +++ td/telegram/MessagesManager.h | 1 - td/telegram/cli.cpp | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index 1f8788c64..fca2c072c 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -797,6 +797,9 @@ void ConfigManager::process_config(tl_object_ptr config) { shared_config.set_option_integer("call_packet_timeout_ms", config->call_packet_timeout_ms_); shared_config.set_option_integer("call_receive_timeout_ms", config->call_receive_timeout_ms_); + shared_config.set_option_integer("message_text_length_max", config->message_length_max_); + shared_config.set_option_integer("message_caption_length_max", config->caption_length_max_); + // delete outdated options shared_config.set_option_empty("chat_big_size"); shared_config.set_option_empty("group_size_max"); diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index fe7f45c8e..173ee9e4e 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -1886,7 +1886,6 @@ class MessagesManager : public Actor { static constexpr int32 MAX_CHANNEL_DIFFERENCE = 100; static constexpr int32 MAX_BOT_CHANNEL_DIFFERENCE = 100000; // server side limit static constexpr int32 MAX_RECENT_FOUND_DIALOGS = 20; // some reasonable value - static constexpr size_t MAX_CAPTION_LENGTH = 200; // server side limit static constexpr size_t MAX_NAME_LENGTH = 255; // server side limit for title and description static constexpr int64 SPONSORED_DIALOG_ORDER = static_cast(2147483647) << 32; static constexpr int32 MIN_PINNED_DIALOG_DATE = 2147000000; // some big date diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index a577f73e4..dfe6b7ee2 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -3005,13 +3005,13 @@ class CliClient final : public Actor { std::tie(supergroup_id, message_id) = split(args); send_request(make_tl_object(to_integer(supergroup_id), as_message_id(message_id), false)); - } else if (op == "pchms") { + } else if (op == "psgms" || op == "pchms") { string supergroup_id; string message_id; std::tie(supergroup_id, message_id) = split(args); send_request(make_tl_object(to_integer(supergroup_id), - as_message_id(message_id), true)); + as_message_id(message_id), false)); } else if (op == "upsgm" || op == "upchm") { send_request(make_tl_object(to_integer(args))); } else if (op == "grib") {