diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index ebc95b845..200889bd7 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -3478,7 +3478,8 @@ void merge_message_contents(Td *td, const MessageContent *old_content, MessageCo const int32 MAX_CUSTOM_ENTITIES_COUNT = 100; // server-side limit if (need_message_changed_warning && need_message_text_changed_warning(old_, new_) && old_->text.entities.size() <= MAX_CUSTOM_ENTITIES_COUNT && - need_message_entities_changed_warning(old_->text.entities, new_->text.entities)) { + need_message_entities_changed_warning(old_->text.entities, new_->text.entities) && + td->option_manager_->get_option_integer("session_count") <= 1) { LOG(WARNING) << "Entities have changed in " << get_content_object(old_content) << ". New content is " << get_content_object(new_content); } diff --git a/td/telegram/MessageEntity.cpp b/td/telegram/MessageEntity.cpp index e7eceb4e7..fd489610b 100644 --- a/td/telegram/MessageEntity.cpp +++ b/td/telegram/MessageEntity.cpp @@ -4341,7 +4341,9 @@ Result get_formatted_text(const Td *td, DialogId dialog_id, TRY_RESULT(entities, get_message_entities(td->contacts_manager_.get(), std::move(text->entities_))); auto need_skip_bot_commands = need_always_skip_bot_commands(td->contacts_manager_.get(), dialog_id, is_bot); bool parse_markdown = td->option_manager_->get_option_boolean("always_parse_markdown"); - TRY_STATUS(fix_formatted_text(text->text_, entities, allow_empty, parse_markdown, need_skip_bot_commands, + bool skip_new_entities = is_bot && td->option_manager_->get_option_integer("session_count") > 1; + TRY_STATUS(fix_formatted_text(text->text_, entities, allow_empty, skip_new_entities || parse_markdown, + skip_new_entities || need_skip_bot_commands, is_bot || skip_media_timestamps || parse_markdown, skip_trim)); FormattedText result{std::move(text->text_), std::move(entities)};