|
|
|
@ -1283,14 +1283,21 @@ TimelineModel::updateLastMessage() |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
TimelineModel::setCurrentIndex(int index) |
|
|
|
|
{ |
|
|
|
|
setCurrentIndex(index, false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
TimelineModel::setCurrentIndex(int index, bool ignoreInactiveState) |
|
|
|
|
{ |
|
|
|
|
auto oldIndex = idToIndex(currentId); |
|
|
|
|
currentId = indexToId(index); |
|
|
|
|
if (index != oldIndex) |
|
|
|
|
emit currentIndexChanged(index); |
|
|
|
|
|
|
|
|
|
if (!QGuiApplication::focusWindow() || !QGuiApplication::focusWindow()->isActive() || |
|
|
|
|
MainWindow::instance()->windowForRoom(roomId()) != QGuiApplication::focusWindow()) |
|
|
|
|
if (!ignoreInactiveState && |
|
|
|
|
(!QGuiApplication::focusWindow() || !QGuiApplication::focusWindow()->isActive() || |
|
|
|
|
MainWindow::instance()->windowForRoom(roomId()) != QGuiApplication::focusWindow())) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
if (!currentId.startsWith('m')) { |
|
|
|
@ -1561,6 +1568,12 @@ TimelineModel::markEventsAsRead(const std::vector<QString> &event_ids) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
TimelineModel::markRoomAsRead() |
|
|
|
|
{ |
|
|
|
|
setCurrentIndex(0, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
TimelineModel::updateLastReadId(const QString ¤tRoomId) |
|
|
|
|
{ |
|
|
|
|