From 37c7fe380b5c22532b583896067c639c55946954 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Fri, 25 Feb 2022 12:28:17 +0100 Subject: [PATCH] Don't load backlog until read marker This is bad if there are a lot of unread messages --- src/messageeventmodel.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/messageeventmodel.cpp b/src/messageeventmodel.cpp index b005f47b9..06e2c9b12 100644 --- a/src/messageeventmodel.cpp +++ b/src/messageeventmodel.cpp @@ -64,21 +64,6 @@ MessageEventModel::MessageEventModel(QObject *parent) qmlRegisterAnonymousType("org.kde.neochat", 1); qRegisterMetaType(); - QTimer::singleShot(0, this, [this]() { - if (!m_currentRoom) { - return; - } - m_currentRoom->getPreviousContent(50); - connect(this, &QAbstractListModel::rowsInserted, this, [this]() { - if (m_currentRoom->readMarkerEventId().isEmpty()) { - return; - } - const auto it = m_currentRoom->findInTimeline(m_currentRoom->readMarkerEventId()); - if (it == m_currentRoom->historyEdge()) { - m_currentRoom->getPreviousContent(50); - } - }); - }); connect(static_cast(QGuiApplication::instance()), &QGuiApplication::paletteChanged, this, [this] { Q_EMIT dataChanged(index(0, 0), index(rowCount() - 1, 0), {AuthorRole, ReplyRole}); });