mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
modules/client/sync/rooms/ephemeral/receipt: Make ephemeral/receipt phase aware; no initial.
This commit is contained in:
parent
9bab37d585
commit
c63374849a
2 changed files with 14 additions and 4 deletions
|
@ -27,7 +27,10 @@ ircd::m::sync::rooms_ephemeral
|
|||
{
|
||||
"rooms.ephemeral",
|
||||
rooms_ephemeral_polylog,
|
||||
rooms_ephemeral_linear
|
||||
rooms_ephemeral_linear,
|
||||
{
|
||||
{ "phased", true }
|
||||
}
|
||||
};
|
||||
|
||||
bool
|
||||
|
|
|
@ -30,7 +30,10 @@ ircd::m::sync::room_ephemeral_m_receipt_m_read
|
|||
{
|
||||
"rooms.ephemeral.m_receipt",
|
||||
room_ephemeral_m_receipt_m_read_polylog,
|
||||
room_ephemeral_m_receipt_m_read_linear
|
||||
room_ephemeral_m_receipt_m_read_linear,
|
||||
{
|
||||
{ "phased", true }
|
||||
}
|
||||
};
|
||||
|
||||
decltype(ircd::m::sync::receipt_scan_depth)
|
||||
|
@ -90,10 +93,14 @@ ircd::m::sync::room_ephemeral_m_receipt_m_read_linear(data &data)
|
|||
bool
|
||||
ircd::m::sync::room_ephemeral_m_receipt_m_read_polylog(data &data)
|
||||
{
|
||||
const m::room &room{*data.room};
|
||||
// With this sync::item being phased=true, this gets called for initial (zero)
|
||||
// and all negative phases. We don't want to incur this load during initial.
|
||||
if(data.phased && int64_t(data.range.first) == 0L)
|
||||
return false;
|
||||
|
||||
m::room::messages it
|
||||
{
|
||||
room
|
||||
*data.room
|
||||
};
|
||||
|
||||
ssize_t i(0);
|
||||
|
|
Loading…
Reference in a new issue