Use set_dialog_last_pinned_message_id instead of on_update_dialog_last_pinned_message_id.

This commit is contained in:
levlam 2021-08-25 11:09:24 +03:00
parent dbdf69d076
commit 628648cd6c

View File

@ -10097,7 +10097,7 @@ bool MessagesManager::update_message_is_pinned(Dialog *d, Message *m, bool is_pi
make_tl_object<td_api::updateMessageIsPinned>(d->dialog_id.get(), m->message_id.get(), is_pinned)); make_tl_object<td_api::updateMessageIsPinned>(d->dialog_id.get(), m->message_id.get(), is_pinned));
if (is_pinned) { if (is_pinned) {
if (d->is_last_pinned_message_id_inited && m->message_id > d->last_pinned_message_id) { if (d->is_last_pinned_message_id_inited && m->message_id > d->last_pinned_message_id) {
on_update_dialog_last_pinned_message_id(d->dialog_id, m->message_id); set_dialog_last_pinned_message_id(d, m->message_id);
} }
} else { } else {
if (d->is_last_pinned_message_id_inited && m->message_id == d->last_pinned_message_id) { if (d->is_last_pinned_message_id_inited && m->message_id == d->last_pinned_message_id) {
@ -32699,7 +32699,7 @@ MessagesManager::Message *MessagesManager::add_message_to_dialog(Dialog *d, uniq
if (*need_update && m->message_id.is_server() && message_content_type == MessageContentType::PinMessage) { if (*need_update && m->message_id.is_server() && message_content_type == MessageContentType::PinMessage) {
auto pinned_message_id = get_message_content_pinned_message_id(m->content.get()); auto pinned_message_id = get_message_content_pinned_message_id(m->content.get());
if (d->is_last_pinned_message_id_inited && pinned_message_id > d->last_pinned_message_id) { if (d->is_last_pinned_message_id_inited && pinned_message_id > d->last_pinned_message_id) {
on_update_dialog_last_pinned_message_id(dialog_id, pinned_message_id); set_dialog_last_pinned_message_id(d, pinned_message_id);
} }
} }