Improve link preview options comparison.

This commit is contained in:
levlam 2023-12-07 21:16:37 +03:00
parent f4f46c9a79
commit 44844e1c19
2 changed files with 6 additions and 7 deletions

View File

@ -4441,10 +4441,10 @@ void compare_message_contents(Td *td, const MessageContent *old_content, const M
const auto *lhs = static_cast<const MessageText *>(old_content);
const auto *rhs = static_cast<const MessageText *>(new_content);
if (lhs->text.text != rhs->text.text || lhs->text.entities != rhs->text.entities ||
lhs->web_page_url != rhs->web_page_url) {
lhs->web_page_url != rhs->web_page_url || lhs->force_small_media != rhs->force_small_media ||
lhs->force_large_media != rhs->force_large_media) {
need_update = true;
} else if (lhs->web_page_id != rhs->web_page_id || lhs->force_small_media != rhs->force_small_media ||
lhs->force_large_media != rhs->force_large_media ||
} else if (lhs->web_page_id != rhs->web_page_id ||
lhs->skip_web_page_confirmation != rhs->skip_web_page_confirmation) {
is_content_changed = true;
if (td == nullptr || td->web_pages_manager_->have_web_page(lhs->web_page_id) ||

View File

@ -36431,9 +36431,6 @@ bool MessagesManager::update_message(Dialog *d, Message *old_message, unique_ptr
// old_message->disable_notification = new_message->disable_notification;
// need_send_update = true;
}
if (old_message->disable_web_page_preview != new_message->disable_web_page_preview) {
old_message->disable_web_page_preview = new_message->disable_web_page_preview;
}
if (old_message->noforwards != new_message->noforwards) {
LOG(DEBUG) << "Message can_be_saved has changed from " << !old_message->noforwards << " to "
@ -36561,7 +36558,9 @@ bool MessagesManager::update_message(Dialog *d, Message *old_message, unique_ptr
if (update_message_content(dialog_id, old_message, std::move(new_message->content),
message_id.is_yet_unsent() && new_message->edit_date == 0, is_message_in_dialog,
is_content_changed) ||
old_message->invert_media != new_message->invert_media) {
old_message->invert_media != new_message->invert_media ||
old_message->disable_web_page_preview != new_message->disable_web_page_preview) {
old_message->disable_web_page_preview = new_message->disable_web_page_preview;
old_message->invert_media = new_message->invert_media;
send_update_message_content(d, old_message, is_message_in_dialog, "update_message");
need_send_update = true;