Add a button to mark spaces as read

[BUG: 508122](https://bugs.kde.org/show_bug.cgi?id=508122)
This commit is contained in:
Azhar Momin
2026-01-24 01:59:51 +05:30
committed by Joshua Goins
parent fb8ee02e3b
commit ade5750550
5 changed files with 109 additions and 0 deletions

View File

@@ -213,6 +213,13 @@ class NeoChatRoom : public Quotient::Room
*/
Q_PROPERTY(bool highlightCycleStarted READ highlightCycleStarted NOTIFY highlightCycleStartedChanged)
/**
* @brief Whether the space has unread messages.
*
* Will always return false if this is not a space.
*/
Q_PROPERTY(bool spaceHasUnreadMessages READ spaceHasUnreadMessages NOTIFY spaceHasUnreadMessagesChanged)
public:
explicit NeoChatRoom(Quotient::Connection *connection, QString roomId, Quotient::JoinState joinState = {});
@@ -652,6 +659,18 @@ public:
*/
bool highlightCycleStarted() const;
/**
* @brief Whether the space has unread messages.
*
* Will always return false if this is not a space.
*/
bool spaceHasUnreadMessages() const;
/**
* @brief Mark the space and all its children messages as read.
*/
Q_INVOKABLE void markAllChildrenMessagesAsRead();
private:
bool m_visible = false;
@@ -722,6 +741,7 @@ Q_SIGNALS:
void inviteTimestampChanged();
void pinnedMessageChanged();
void highlightCycleStartedChanged();
void spaceHasUnreadMessagesChanged();
/**
* @brief Request a message be shown to the user of the given type.