From 2d932dc29fb70ba0db07cccef406e200891c7e35 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 12 Sep 2023 15:35:27 +0200 Subject: [PATCH] feat: don't process the `limited` flag for e2ee-only sliding syncs --- crates/matrix-sdk/src/sliding_sync/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/matrix-sdk/src/sliding_sync/mod.rs b/crates/matrix-sdk/src/sliding_sync/mod.rs index 0c293a2b9..56d8ab591 100644 --- a/crates/matrix-sdk/src/sliding_sync/mod.rs +++ b/crates/matrix-sdk/src/sliding_sync/mod.rs @@ -310,8 +310,10 @@ impl SlidingSync { } } - // Compute `limited`. - { + let must_process_rooms_response = self.must_process_rooms_response().await; + + // Compute `limited`, if we're interested in a room list query. + if must_process_rooms_response { let known_rooms = self.inner.rooms.read().await; compute_limited(&known_rooms, &mut sliding_sync_response.rooms); } @@ -336,7 +338,7 @@ impl SlidingSync { // unrelated to the current connection's parameters. // // NOTE: SS proxy workaround. - if self.must_process_rooms_response().await { + if must_process_rooms_response { response_processor.handle_room_response(&sliding_sync_response).await?; }