From bffca57da1f82acbbc99cafb23d72711b4702078 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 31 May 2020 22:42:58 +0300 Subject: [PATCH] Preload pinned message only for from_update messages to prevent cycles and because only such messages can cause updating of last_new_message_id. GitOrigin-RevId: 153f8699db19652f142334ef5b3413276892e2cd --- td/telegram/MessagesManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 8d89c1b0f..8ac2c207f 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -28521,7 +28521,7 @@ MessagesManager::Message *MessagesManager::add_message_to_dialog(Dialog *d, uniq // in get_message_notification_group_force get_dialog_notification_group_id(d->dialog_id, get_notification_group_info(d, message.get())); } - if (*need_update || (!d->last_new_message_id.is_valid() && !message_id.is_yet_unsent())) { + if (*need_update || (!d->last_new_message_id.is_valid() && !message_id.is_yet_unsent() && from_update)) { auto pinned_message_id = get_message_content_pinned_message_id(message->content.get()); if (pinned_message_id.is_valid() && pinned_message_id < message_id && have_message_force({dialog_id, pinned_message_id}, "preload pinned message")) {