mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-13 12:16:54 +00:00
fix(sync): Omit empty room account data from sliding sync responses
This commit is contained in:
1 parent
5117b104af
commit
9bb203abe8
2 files changed
+15
-8
No files matched your search
@@ -0,0 +1 @@
|
||||
Sliding sync responses no longer include an empty room account data entry for every room in a list's range. Contributed by @eleboucher.
|
||||
@@ -855,15 +855,21 @@ where
|
||||
};
|
||||
|
||||
if body.extensions.account_data.enabled == Some(true) {
|
||||
response.extensions.account_data.rooms.insert(
|
||||
room_id.to_owned(),
|
||||
services
|
||||
let room_account_data: Vec<_> = services
|
||||
.account_data
|
||||
.changes_since(Some(room_id), sender_user, Some(*roomsince), Some(next_batch))
|
||||
.ready_filter_map(|e| extract_variant!(e, AnyRawAccountDataEvent::Room))
|
||||
.collect()
|
||||
.await;
|
||||
|
||||
// An empty entry makes clients treat the room as updated.
|
||||
if !room_account_data.is_empty() {
|
||||
response
|
||||
.extensions
|
||||
.account_data
|
||||
.changes_since(Some(room_id), sender_user, Some(*roomsince), Some(next_batch))
|
||||
.ready_filter_map(|e| extract_variant!(e, AnyRawAccountDataEvent::Room))
|
||||
.collect()
|
||||
.await,
|
||||
);
|
||||
.rooms
|
||||
.insert(room_id.to_owned(), room_account_data);
|
||||
}
|
||||
}
|
||||
|
||||
let last_privateread_update = services
|
||||
|
||||
Reference in new issue
Block a user