mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 21:26:50 +00:00
Provide sync watch rooms as argument rather than assuming all joined rooms.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
1 parent
6c724bbc2f
commit
a6127fcd1a
3 files changed
+25
-12
No files matched your search
@@ -163,10 +163,14 @@ pub(crate) async fn sync_events_route(
|
||||
.expect("configuration must limit maximum timeout");
|
||||
|
||||
loop {
|
||||
let watchers = services.sync.watch(sender_user, sender_device);
|
||||
let next_batch = services.globals.wait_pending().await?;
|
||||
let watch_rooms = services.state_cache.rooms_joined(sender_user);
|
||||
let watchers = services
|
||||
.sync
|
||||
.watch(sender_user, sender_device, watch_rooms);
|
||||
|
||||
let next_batch = services.globals.wait_pending().await?;
|
||||
debug_assert!(since <= next_batch, "next_batch is monotonic");
|
||||
|
||||
if since < next_batch || body.body.full_state {
|
||||
let response = build_sync_events(&services, &body, since, next_batch).await?;
|
||||
let empty = response.rooms.is_empty()
|
||||
|
||||
Reference in new issue
Block a user