Treat read markers as item in the model

This commit is contained in:
Carl Schwan
2021-05-21 17:46:34 +00:00
parent 0bc51627bb
commit b5edfc909e
4 changed files with 139 additions and 49 deletions

View File

@@ -24,7 +24,6 @@ public:
ContentRole,
ContentTypeRole,
HighlightRole,
ReadMarkerRole,
SpecialMarksRole,
LongOperationRole,
AnnotationRole,
@@ -45,13 +44,6 @@ public:
};
Q_ENUM(EventRoles)
enum BubbleShapes {
NoShape = 0,
BeginShape,
MiddleShape,
EndShape,
};
explicit MessageEventModel(QObject *parent = nullptr);
~MessageEventModel() override;
@@ -76,6 +68,7 @@ private Q_SLOTS:
private:
NeoChatRoom *m_currentRoom = nullptr;
QString lastReadEventId;
QPersistentModelIndex m_lastReadEventIndex;
int rowBelowInserted = -1;
bool movingEvent = false;
@@ -86,6 +79,7 @@ private:
void refreshLastUserEvents(int baseTimelineRow);
void refreshEventRoles(int row, const QVector<int> &roles = {});
int refreshEventRoles(const QString &eventId, const QVector<int> &roles = {});
void moveReadMarker(const QString &fromEventId, const QString &toEventId);
Q_SIGNALS:
void roomChanged();