implement per-event state filtering for invited rooms on /sync

This one is a little weird, because the stripped invite state events are
not deserialized.
This commit is contained in:
Benjamin Lee 2024-05-10 19:00:57 -07:00
parent 4c9728cbad
commit b85110a292
No known key found for this signature in database
GPG key ID: FB9624E2885D55A4
2 changed files with 47 additions and 3 deletions

View file

@ -262,9 +262,14 @@ pub(crate) async fn sync_events_route(
continue;
}
let state_events = invite_state_events
.into_iter()
.filter(|event| compiled_filter.room.state.raw_event_allowed(event))
.collect();
let invited_room = InvitedRoom {
invite_state: InviteState {
events: invite_state_events,
events: state_events,
},
};
if !invited_room.is_empty() {