mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-07-12 01:16:40 +02:00
skip left/invited rooms with no updates in /sync
Before this change we were just returning an empty object for left or invited rooms that don't have any updates. This is valid coloredding to the spec, but it's a nicer to debug if they are omitted it and results in a little less network traffic. For joined rooms, we are already skipping empty updates. With filtering support, it's much more common to have sync responses where many rooms are empty, because all of the state/timeline events may be filtered out.
This commit is contained in:
parent
4b6e2fae52
commit
0aae761da4
1 changed files with 16 additions and 16 deletions
|
@ -460,16 +460,16 @@ async fn sync_helper(
|
|||
}
|
||||
};
|
||||
|
||||
left_rooms.insert(
|
||||
room_id.into_owned(),
|
||||
LeftRoom {
|
||||
account_data: RoomAccountData {
|
||||
events: Vec::new(),
|
||||
},
|
||||
timeline,
|
||||
state,
|
||||
let left_room = LeftRoom {
|
||||
account_data: RoomAccountData {
|
||||
events: Vec::new(),
|
||||
},
|
||||
);
|
||||
timeline,
|
||||
state,
|
||||
};
|
||||
if !left_room.is_empty() {
|
||||
left_rooms.insert(room_id.into_owned(), left_room);
|
||||
}
|
||||
}
|
||||
|
||||
let mut invited_rooms = BTreeMap::new();
|
||||
|
@ -519,14 +519,14 @@ async fn sync_helper(
|
|||
continue;
|
||||
}
|
||||
|
||||
invited_rooms.insert(
|
||||
room_id.into_owned(),
|
||||
InvitedRoom {
|
||||
invite_state: InviteState {
|
||||
events: invite_state_events,
|
||||
},
|
||||
let invited_room = InvitedRoom {
|
||||
invite_state: InviteState {
|
||||
events: invite_state_events,
|
||||
},
|
||||
);
|
||||
};
|
||||
if !invited_room.is_empty() {
|
||||
invited_rooms.insert(room_id.into_owned(), invited_room);
|
||||
}
|
||||
}
|
||||
|
||||
for user_id in left_encrypted_users {
|
||||
|
|
Loading…
Add table
Reference in a new issue