Add message_*_length_max options.

GitOrigin-RevId: 27fc7c79b0820916daaf23745078a4204c3dc6c9
This commit is contained in:
levlam 2018-06-27 02:28:49 +03:00
parent e806037eea
commit b20c77d459
3 changed files with 5 additions and 3 deletions

View File

@ -797,6 +797,9 @@ void ConfigManager::process_config(tl_object_ptr<telegram_api::config> 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");

View File

@ -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<int64>(2147483647) << 32;
static constexpr int32 MIN_PINNED_DIALOG_DATE = 2147000000; // some big date

View File

@ -3005,13 +3005,13 @@ class CliClient final : public Actor {
std::tie(supergroup_id, message_id) = split(args);
send_request(make_tl_object<td_api::pinSupergroupMessage>(to_integer<int32>(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<td_api::pinSupergroupMessage>(to_integer<int32>(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<td_api::unpinSupergroupMessage>(to_integer<int32>(args)));
} else if (op == "grib") {