Simplify on_update_dialog_last_pinned_message_id.

This commit is contained in:
levlam 2021-08-25 11:03:07 +03:00
parent bba085318e
commit dbdf69d076

View File

@ -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;