Better get_next_message_id.

GitOrigin-RevId: bcbc48c0e68ef69a1c7e0359cb7f405a772d8bd6
This commit is contained in:
levlam 2018-01-12 19:28:32 +03:00
parent 06cf561b88
commit cd7de92955

View File

@ -18152,7 +18152,8 @@ void MessagesManager::on_send_message_fail(int64 random_id, Status error) {
MessageId MessagesManager::get_next_message_id(Dialog *d, int32 type) { MessageId MessagesManager::get_next_message_id(Dialog *d, int32 type) {
CHECK(d != nullptr); CHECK(d != nullptr);
int64 last = std::max({d->last_message_id.get(), d->last_new_message_id.get(), d->last_database_message_id.get(), int64 last = std::max({d->last_message_id.get(), d->last_new_message_id.get(), d->last_database_message_id.get(),
d->last_assigned_message_id.get()}); d->last_assigned_message_id.get(), d->last_clear_history_message_id.get(),
d->deleted_last_message_id.get(), d->max_unavailable_message_id.get()});
if (last < d->last_read_inbox_message_id.get() && if (last < d->last_read_inbox_message_id.get() &&
d->last_read_inbox_message_id.get() < d->last_new_message_id.get() + MessageId::FULL_TYPE_MASK) { d->last_read_inbox_message_id.get() < d->last_new_message_id.get() + MessageId::FULL_TYPE_MASK) {
last = d->last_read_inbox_message_id.get(); last = d->last_read_inbox_message_id.get();