From 7ddcab3902a6b39c3ed8328c245f58a495b4c43f Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 13 Feb 2021 01:41:09 +0100 Subject: Mark messages as read, when Nheko gets focused fixes #235 --- src/timeline/TimelineModel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index 0f35a290..5c904932 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -735,14 +735,14 @@ TimelineModel::updateLastMessage() void TimelineModel::setCurrentIndex(int index) { - if (!ChatPage::instance()->isActiveWindow()) - return; - auto oldIndex = idToIndex(currentId); currentId = indexToId(index); if (index != oldIndex) emit currentIndexChanged(index); + if (!ChatPage::instance()->isActiveWindow()) + return; + if (!currentId.startsWith("m")) { auto oldReadIndex = cache::getEventIndex(roomId().toStdString(), currentReadId.toStdString()); -- cgit 1.5.1