mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 07:54:05 +01:00
modules/client/sync/rooms/unread_notifications: Make this a phased polylog handler.
This commit is contained in:
parent
1fb853dd83
commit
f158fedddb
1 changed files with 11 additions and 1 deletions
|
@ -31,6 +31,9 @@ ircd::m::sync::room_unread_notifications
|
|||
"rooms.unread_notifications",
|
||||
room_unread_notifications_polylog,
|
||||
room_unread_notifications_linear,
|
||||
{
|
||||
{ "phased", true },
|
||||
}
|
||||
};
|
||||
|
||||
bool
|
||||
|
@ -183,9 +186,16 @@ ircd::m::sync::room_unread_notifications_polylog(data &data)
|
|||
if(!marker_idx)
|
||||
return false;
|
||||
|
||||
const bool initial_phase
|
||||
{
|
||||
data.phased && data.range.first == 0
|
||||
};
|
||||
|
||||
const auto notification_count
|
||||
{
|
||||
_notification_count(room, marker_idx, data.range.second)
|
||||
!initial_phase?
|
||||
_notification_count(room, marker_idx, data.range.second):
|
||||
0L
|
||||
};
|
||||
|
||||
json::stack::member
|
||||
|
|
Loading…
Reference in a new issue