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:
@@ -56,6 +56,8 @@ NeoChatRoom::NeoChatRoom(Connection *connection, QString roomId, JoinState joinS
|
||||
|
||||
NotificationsManager::instance().postNotification(id(), lastEvent->id(), displayName(), sender->displayname(this), eventToString(*lastEvent), avatar(128));
|
||||
});
|
||||
|
||||
connect(this, &Room::aboutToAddHistoricalMessages, this, &NeoChatRoom::readMarkerLoadedChanged);
|
||||
}
|
||||
|
||||
void NeoChatRoom::uploadFile(const QUrl &url, const QString &body)
|
||||
@@ -613,3 +615,9 @@ bool NeoChatRoom::canSendState(const QString &eventType) const
|
||||
|
||||
return currentPl >= pl;
|
||||
}
|
||||
|
||||
bool NeoChatRoom::readMarkerLoaded() const
|
||||
{
|
||||
const auto it = findInTimeline(readMarkerEventId());
|
||||
return it != timelineEdge();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user