mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
fix: Use prepare_lazily_loaded_members for joined rooms
Also, don't take read receipts into consideration for lazy loading. Synapse doesn't do this and they're making initial syncs very large.
This commit is contained in:
@@ -430,8 +430,19 @@ async fn prepare_lazily_loaded_members(
|
||||
) -> Option<MemberSet> {
|
||||
let lazy_loading_context = &sync_context.lazy_loading_context(room_id);
|
||||
|
||||
// the user IDs of members whose membership needs to be sent to the client, if
|
||||
// lazy-loading is enabled.
|
||||
// reset lazy loading state on initial sync.
|
||||
// do this even if lazy loading is disabled so future lazy loads
|
||||
// will have the correct members.
|
||||
if sync_context.since.is_none() {
|
||||
services
|
||||
.rooms
|
||||
.lazy_loading
|
||||
.reset(lazy_loading_context)
|
||||
.await;
|
||||
}
|
||||
|
||||
// filter the input members through `retain_lazy_members`, which
|
||||
// contains the actual lazy loading logic.
|
||||
let lazily_loaded_members =
|
||||
OptionFuture::from(sync_context.lazy_loading_enabled().then(|| {
|
||||
services
|
||||
@@ -441,14 +452,5 @@ async fn prepare_lazily_loaded_members(
|
||||
}))
|
||||
.await;
|
||||
|
||||
// reset lazy loading state on initial sync
|
||||
if sync_context.since.is_none() {
|
||||
services
|
||||
.rooms
|
||||
.lazy_loading
|
||||
.reset(lazy_loading_context)
|
||||
.await;
|
||||
}
|
||||
|
||||
lazily_loaded_members
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user