diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2016-10-21 12:51:01 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2016-10-21 12:52:49 +0900 |
commit | c8700b59d00d505c59de51d8dc259454073123e3 (patch) | |
tree | eed310f8e41aceda5e3a916de5641b69cedddbae /room.h | |
parent | 372ed74c04f2c542451771aa792242a4e2afb351 (diff) | |
download | libquotient-c8700b59d00d505c59de51d8dc259454073123e3.tar.gz libquotient-c8700b59d00d505c59de51d8dc259454073123e3.zip |
Room::markMessagesAsRead correctly handles local user's messages now
setLastReadEvent() is called in any case (read marks a stored in a hashmap so it's a constant time operation anyway); postReceipt() is now called for the nearest previous non-local message.
Diffstat (limited to 'room.h')
-rw-r--r-- | room.h | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -69,9 +69,22 @@ namespace QMatrixClient Q_INVOKABLE void updateData(SyncRoomData& data ); Q_INVOKABLE void setJoinState( JoinState state ); - Q_INVOKABLE void setLastReadEvent(User* user, QString eventId); - Q_INVOKABLE void markMessageAsRead( Event* event ); Q_INVOKABLE QString lastReadEvent(User* user); + Q_INVOKABLE void setLastReadEvent(User* user, QString eventId); + /** + * @brief Mark the message at the iterator 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. + */ + Q_INVOKABLE void markMessagesAsRead(Timeline::const_iterator iter); + /** + * @brief Mark the most recent message in the timeline as read + * + * This effectively marks everything in the room as read. + */ + Q_INVOKABLE void markMessagesAsRead(); Q_INVOKABLE int notificationCount() const; Q_INVOKABLE void resetNotificationCount(); |