Fix loading events when scrolling or opening a room for the first time

Fix #362
This commit is contained in:
Carl Schwan
2021-05-23 18:24:55 +02:00
parent dded804f00
commit bae7813f68
3 changed files with 30 additions and 12 deletions

View File

@@ -370,6 +370,20 @@ int MessageEventModel::rowCount(const QModelIndex &parent) const
}
bool MessageEventModel::canFetchMore(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return m_currentRoom && !m_currentRoom->eventsHistoryJob() && !m_currentRoom->allHistoryLoaded();
}
void MessageEventModel::fetchMore(const QModelIndex &parent)
{
Q_UNUSED(parent);
m_currentRoom->getPreviousContent(20);
}
inline QVariantMap userAtEvent(NeoChatUser *user, NeoChatRoom *room, const RoomEvent &evt)
{
Q_UNUSED(evt)