diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-11-21 06:55:16 +0100 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-11-21 07:07:00 +0100 |
commit | b2f9b212c78bc9dd7c69f6a2d1f94376adb488e3 (patch) | |
tree | 4a282de17e2b6157b1ce3dc97b2b245853adc304 /lib/csapi | |
parent | e7babe6715672a358f7cc8b90d5df27e21a1b3e8 (diff) | |
download | libquotient-b2f9b212c78bc9dd7c69f6a2d1f94376adb488e3.tar.gz libquotient-b2f9b212c78bc9dd7c69f6a2d1f94376adb488e3.zip |
EventStats and Room::partiallyRead/unreadStats()
This introduces a new API to count unread events that would allow to
obtain those unread and highlight counts since either the fully read
marker (Room::partiallyReadStats) or the last read receipt
(Room::unreadStats). Element uses the read receipt as the anchor
to count unread numbers, while Quaternion historically used the fully
read marker for that (with the pre-0.7 library sticking the two markers
to each other). From now on the meaning of "unread" in Quotient is
aligned with that of the spec and Element, and "partially read" means
events between the fully read marker and the local read receipt;
the design allows client authors to use either or both counting
strategies as they see fit. Respectively, Room::P::setFullyReadMarker()
updates partially-read statistics, while Room::P::setLastReadReceipt(),
when called on a local user, updates unread statistics.
Room::notificationCount() and Room::highlightCount() maintain their
previous meaning as the counters since the last read receipt;
Room::notificationCount() counts unread events locally, falling back
to the value from the above-mentioned key defined by MSC2654, and if
that is not there, further to `unread_notifications/notification_count`
defined in the current spec. Room::highlightCount(), however, is still
taken from the homeserver, not from Room::unreadStats().highlightCount.
Diffstat (limited to 'lib/csapi')
0 files changed, 0 insertions, 0 deletions