Allow the condition for when messages are automatically marked as read to be configurable.

Title this adds a number of options for when messages should be automatically marked as read for the user to choose from.

![image](/uploads/cef95f8c6c77bfdcabb7a8a309bc1fd2/image.png){width=480 height=262}
This commit is contained in:
James Graham
2025-07-04 14:36:36 +01:00
parent d5d291396d
commit 3d9d211d25
11 changed files with 160 additions and 42 deletions

View File

@@ -125,7 +125,12 @@ Q_SIGNALS:
/**
* @brief Emitted when the room is changed.
*/
void roomChanged();
void roomAboutToChange(NeoChatRoom *oldRoom, NeoChatRoom *newRoom);
/**
* @brief Emitted when the room is changed.
*/
void roomChanged(NeoChatRoom *oldRoom, NeoChatRoom *newRoom);
/**
* @brief Emitted when the reader marker is added.
@@ -140,7 +145,7 @@ Q_SIGNALS:
/**
* @brief Emitted when the model is about to reset.
*/
void modelAboutToBeReset();
void modelAboutToReset();
/**
* @brief Emitted when the model has been reset.
@@ -169,6 +174,9 @@ protected:
virtual int timelineServerIndex() const;
virtual std::optional<std::reference_wrapper<const Quotient::RoomEvent>> getEventForIndex(QModelIndex index) const;
bool m_resetting = false;
bool m_movingEvent = false;
void fullEventRefresh(int row);
int refreshEventRoles(const QString &eventId, const QList<int> &roles = {});
void refreshEventRoles(int row, const QList<int> &roles = {});
@@ -182,9 +190,6 @@ protected:
bool event(QEvent *event) override;
private:
bool resetting = false;
bool movingEvent = false;
QMap<QString, QSharedPointer<ReadMarkerModel>> m_readMarkerModels;
void createEventObjects(const Quotient::RoomEvent *event);