Remove redundant check, existing also in get_history_impl.

This commit is contained in:
levlam 2023-06-07 15:14:45 +03:00
parent 677219a251
commit 7d83f2e15a

View File

@ -23398,15 +23398,10 @@ void MessagesManager::load_messages_impl(const Dialog *d, MessageId from_message
only_local = true;
}
bool from_database = (left_tries > 2 || only_local) && G()->use_message_database();
if (from_message_id == MessageId()) {
get_history_from_the_end_impl(d, from_database, only_local, std::move(promise), "load_messages_impl");
return;
}
if ((!d->first_database_message_id.is_valid() || from_message_id <= d->first_database_message_id) &&
!d->have_full_history) {
from_database = false;
}
if (offset >= -1) {
// get history before some server or local message
limit = min(max(limit + offset + 1, MAX_GET_HISTORY / 2), MAX_GET_HISTORY);