0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

modules/client/sync/rooms/unread_notifications: Make this a phased polylog handler.

This commit is contained in:
Jason Volk 2022-07-09 15:52:39 -07:00
parent 1fb853dd83
commit f158fedddb

View file

@ -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