aboutsummaryrefslogtreecommitdiff
path: root/room.h
diff options
context:
space:
mode:
authorKitsuneRal <Kitsune-Ral@users.sf.net>2016-10-24 09:04:35 +0900
committerGitHub <noreply@github.com>2016-10-24 09:04:35 +0900
commit9a1270dbf8cf6c2dc9337c33a3c59b437676548c (patch)
tree8c77a5ebf5d7660bf78add62498a1e57298f84ab /room.h
parenta5962ee1fb1ccfa641217778e6bf7f4e9c53dff1 (diff)
parentcaaddebae6acf1a1c5281a5beba43782a8c899fc (diff)
downloadlibquotient-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.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/room.h b/room.h
index 7266ae70..fb3212e9 100644
--- a/room.h
+++ b/room.h
@@ -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);
};
}