From 26b9146c32c615243774e4257eae5501b2ea397e Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 17 Sep 2021 14:27:34 +0300 Subject: [PATCH] Beta version 3.0.5: Try fixing messages skipping. --- Telegram/SourceFiles/history/history.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Telegram/SourceFiles/history/history.cpp b/Telegram/SourceFiles/history/history.cpp index 420968ae47..b2bba99d84 100644 --- a/Telegram/SourceFiles/history/history.cpp +++ b/Telegram/SourceFiles/history/history.cpp @@ -487,6 +487,19 @@ not_null History::addNewItem( } else if (!item->isHistoryEntry()) { return item; } + + // In case we've loaded a new 'last' message + // and it is not in blocks and we think that + // we have all the messages till the bottom + // we should unload known history or mark + // currently loaded slice as not reaching bottom. + const auto shouldMarkBottomNotLoaded = loadedAtBottom() + && !unread + && !isEmpty(); + if (shouldMarkBottomNotLoaded) { + setNotLoadedAtBottom(); + } + if (!loadedAtBottom() || peer->migrateTo()) { setLastMessage(item); if (unread) {