diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index d29be6f8a..a7688941a 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -29634,19 +29634,6 @@ void MessagesManager::on_update_dialog_last_pinned_message_id(DialogId dialog_id return; } - if (d->last_pinned_message_id == pinned_message_id) { - LOG(INFO) << "Pinned message in " << d->dialog_id << " is still " << pinned_message_id; - if (!d->is_last_pinned_message_id_inited) { - d->is_last_pinned_message_id_inited = true; - on_dialog_updated(dialog_id, "on_update_dialog_last_pinned_message_id"); - } - Message *m = get_message_force(d, pinned_message_id, "on_update_dialog_last_pinned_message_id"); - if (m != nullptr && update_message_is_pinned(d, m, true, "on_update_dialog_last_pinned_message_id")) { - on_message_changed(d, m, true, "on_update_dialog_last_pinned_message_id"); - } - return; - } - set_dialog_last_pinned_message_id(d, pinned_message_id); } @@ -29657,7 +29644,7 @@ void MessagesManager::set_dialog_last_pinned_message_id(Dialog *d, MessageId pin on_message_changed(d, m, true, "set_dialog_last_pinned_message_id"); } - if (d->last_pinned_message_id == pinned_message_id) { + if (d->is_last_pinned_message_id_inited && d->last_pinned_message_id == pinned_message_id) { return; } d->last_pinned_message_id = pinned_message_id;