Add default values for message_text_length_max and message_caption_length_max options.

GitOrigin-RevId: 4f2d3d087d17ec5e7aeb62933c5525a7e12d6ca7
This commit is contained in:
levlam 2018-07-12 03:50:58 +03:00
parent e72368d208
commit 1a82e6d3f1

View File

@ -3995,6 +3995,13 @@ Status Td::init(DbKey key) {
// options_.proxy = Proxy(); // options_.proxy = Proxy();
G()->set_mtproto_header(std::make_unique<MtprotoHeader>(options_)); G()->set_mtproto_header(std::make_unique<MtprotoHeader>(options_));
if (!G()->shared_config().have_option("message_text_length_max")) {
G()->shared_config().set_option_integer("message_text_length_max", 4096);
}
if (!G()->shared_config().have_option("message_caption_length_max")) {
G()->shared_config().set_option_integer("message_caption_length_max", 200);
}
VLOG(td_init) << "Create NetQueryDispatcher"; VLOG(td_init) << "Create NetQueryDispatcher";
auto net_query_dispatcher = std::make_unique<NetQueryDispatcher>([&] { return create_reference(); }); auto net_query_dispatcher = std::make_unique<NetQueryDispatcher>([&] { return create_reference(); });
G()->set_net_query_dispatcher(std::move(net_query_dispatcher)); G()->set_net_query_dispatcher(std::move(net_query_dispatcher));