Mark history as read at the bottom in any case.

This commit is contained in:
John Preston 2017-08-11 19:53:19 +03:00
parent bca444b92e
commit 71e0e6ac4d

View file

@ -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);
}
}