From 71e0e6ac4db5e37c98bcc39e75d157ff0df087ea Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 11 Aug 2017 19:53:19 +0300 Subject: [PATCH] Mark history as read at the bottom in any case. --- Telegram/SourceFiles/history/history_widget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 5f2120561..64d084613 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -2545,7 +2545,9 @@ void HistoryWidget::visibleAreaUpdated() { _list->visibleAreaUpdated(scrollTop, scrollBottom); if (_history->loadedAtBottom() && (_history->unreadCount() > 0 || (_migrated && _migrated->unreadCount() > 0))) { auto showFrom = (_migrated && _migrated->showFrom) ? _migrated->showFrom : (_history ? _history->showFrom : nullptr); - if (showFrom && !showFrom->detached() && scrollBottom > _list->itemTop(showFrom) && App::wnd()->doWeReadServerHistory()) { + auto showFromVisible = (showFrom && !showFrom->detached() && scrollBottom > _list->itemTop(showFrom)); + auto atBottom = (scrollTop >= _scroll->scrollTopMax()); + if ((showFromVisible || atBottom) && App::wnd()->doWeReadServerHistory()) { historyWasRead(ReadServerHistoryChecks::OnlyIfUnread); } }