Fix default last_new_message_id in secret chats, broken in 9948e41aed.

This commit is contained in:
levlam 2021-03-29 20:52:59 +03:00
parent ad495c0d0c
commit 732193b346

View File

@ -33851,9 +33851,9 @@ MessagesManager::Dialog *MessagesManager::add_new_dialog(unique_ptr<Dialog> &&d,
break; break;
} }
case DialogType::SecretChat: case DialogType::SecretChat:
if (!d->last_new_message_id.is_valid()) { if (d->last_new_message_id.get() <= MessageId::min().get()) {
LOG(INFO) << "Set " << d->dialog_id << " last new message in add_new_dialog"; LOG(INFO) << "Set " << d->dialog_id << " last new message in add_new_dialog";
d->last_new_message_id = MessageId::min(); d->last_new_message_id = MessageId::min().get_next_message_id(MessageType::Local);
} }
if (!d->notification_settings.is_secret_chat_show_preview_fixed) { if (!d->notification_settings.is_secret_chat_show_preview_fixed) {