Improve the 'jump to last read message' button
When loading a room, automatically load messages until the last read message is loaded #35 Don't show the button if the message is not loaded
This commit is contained in:
@@ -55,6 +55,19 @@ MessageEventModel::MessageEventModel(QObject *parent)
|
||||
qmlRegisterAnonymousType<FileTransferInfo>("org.kde.neochat", 1);
|
||||
qRegisterMetaType<FileTransferInfo>();
|
||||
qmlRegisterUncreatableType<EventStatus>("org.kde.neochat", 1, 0, "EventStatus", "EventStatus is not an creatable type");
|
||||
|
||||
QTimer::singleShot(0, this, [=]() {
|
||||
m_currentRoom->getPreviousContent(50);
|
||||
connect(this, &QAbstractListModel::rowsInserted, this, [=](){
|
||||
if(m_currentRoom->readMarkerEventId().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
const auto it = m_currentRoom->findInTimeline(m_currentRoom->readMarkerEventId());
|
||||
if (it == m_currentRoom->timelineEdge()) {
|
||||
m_currentRoom->getPreviousContent(50);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
MessageEventModel::~MessageEventModel()
|
||||
|
||||
Reference in New Issue
Block a user