diff options
author | KitsuneRal <Kitsune-Ral@users.sf.net> | 2016-10-24 09:04:35 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-24 09:04:35 +0900 |
commit | 9a1270dbf8cf6c2dc9337c33a3c59b437676548c (patch) | |
tree | 8c77a5ebf5d7660bf78add62498a1e57298f84ab /room.h | |
parent | a5962ee1fb1ccfa641217778e6bf7f4e9c53dff1 (diff) | |
parent | caaddebae6acf1a1c5281a5beba43782a8c899fc (diff) | |
download | libquotient-9a1270dbf8cf6c2dc9337c33a3c59b437676548c.tar.gz libquotient-9a1270dbf8cf6c2dc9337c33a3c59b437676548c.zip |
Merge pull request #44 from Fxrh/kitsune-read-receipts
Room: added setLastReadEvent accessor and a signal for it; don't post receipts for own messages to the server
Diffstat (limited to 'room.h')
-rw-r--r-- | room.h | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -69,8 +69,21 @@ namespace QMatrixClient Q_INVOKABLE void updateData(SyncRoomData& data ); Q_INVOKABLE void setJoinState( JoinState state ); - Q_INVOKABLE void markMessageAsRead( Event* event ); Q_INVOKABLE QString lastReadEvent(User* user); + /** + * @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 last); + /** + * @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(); @@ -102,6 +115,7 @@ namespace QMatrixClient void typingChanged(); void highlightCountChanged(Room* room); void notificationCountChanged(Room* room); + void lastReadEventChanged(User* user); protected: Connection* connection() const; @@ -110,12 +124,16 @@ namespace QMatrixClient virtual void processStateEvents(const Events& events); virtual void processEphemeralEvent(Event* event); + bool promoteReadMarker(User* user, QString eventId); + private: class Private; Private* d; void addNewMessageEvents(const Events& events); void addHistoricalMessageEvents(const Events& events); + + void setLastReadEvent(User* user, QString eventId); }; } |