Skip to content

Commit 0b7aad2

Browse files
committed
client-api: Account for knocked rooms in Rooms::is_empty
The `rooms` field is skipped at serialization when `Rooms::is_empty` returns true. The method omitted `knock`, so a sync whose only updates are knocked rooms dropped the entire `rooms` object, leaving the knocker's own knock absent from /sync. Signed-off-by: Jason Volk <jason@zemos.net>
1 parent d4d7b97 commit 0b7aad2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • crates/ruma-client-api/src/sync/sync_events

crates/ruma-client-api/src/sync/sync_events/v3.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,10 @@ impl Rooms {
213213

214214
/// Returns true if there is no update in any room.
215215
pub fn is_empty(&self) -> bool {
216-
self.leave.is_empty() && self.join.is_empty() && self.invite.is_empty()
216+
self.leave.is_empty()
217+
&& self.join.is_empty()
218+
&& self.invite.is_empty()
219+
&& self.knock.is_empty()
217220
}
218221
}
219222

0 commit comments

Comments
 (0)