aboutsummaryrefslogtreecommitdiff
path: root/room.h
diff options
context:
space:
mode:
Diffstat (limited to 'room.h')
-rw-r--r--room.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/room.h b/room.h
index 79c765ba..a518ae42 100644
--- a/room.h
+++ b/room.h
@@ -37,6 +37,7 @@ namespace QMatrixClient
class Room: public QObject
{
Q_OBJECT
+ Q_PROPERTY(QString readMarkerEventId READ readMarkerEventId WRITE markMessagesAsRead NOTIFY readMarkerPromoted)
public:
using Timeline = Owning<Events>;
@@ -70,19 +71,19 @@ namespace QMatrixClient
Q_INVOKABLE void updateData(SyncRoomData& data );
Q_INVOKABLE void setJoinState( JoinState state );
- Q_INVOKABLE QString lastReadEvent(User* user);
+ Q_INVOKABLE QString lastReadEvent(User* user) const;
+ QString readMarkerEventId() const;
/**
- * @brief Mark the message at the iterator as read
+ * @brief Mark the event with uptoEventId as read
*
- * Marks the message at the iterator as read; also posts a read
- * receipt to the server either for this message or, if it's from
- * the local user, for the nearest non-local message before.
+ * Finds in the timeline and marks as read the event with
+ * the specified id; also posts a read receipt to the server either
+ * for this message or, if it's from the local user, for
+ * the nearest non-local message before.
*/
- Q_INVOKABLE void markMessagesAsRead(Timeline::const_iterator last);
+ Q_INVOKABLE void markMessagesAsRead(QString uptoEventId);
/**
- * @brief Mark the most recent message in the timeline as read
- *
- * This effectively marks everything in the room as read.
+ * @brief Mark the whole room timeline as read
*/
Q_INVOKABLE void markMessagesAsRead();
@@ -121,6 +122,7 @@ namespace QMatrixClient
void highlightCountChanged(Room* room);
void notificationCountChanged(Room* room);
void lastReadEventChanged(User* user);
+ void readMarkerPromoted();
void unreadMessagesChanged(Room* room);
protected:
@@ -130,7 +132,7 @@ namespace QMatrixClient
virtual void processStateEvents(const Events& events);
virtual void processEphemeralEvent(Event* event);
- bool promoteReadMarker(QString newLastReadEventId);
+ Timeline::const_iterator promoteReadMarker(QString eventId);
private:
class Private;