feat: respect history visibility

This commit is contained in:
Timo Kösters 2023-02-22 15:49:55 +01:00
commit 10fa686c77
No known key found for this signature in database
GPG key ID: 0B25E636FBA7E4CB
8 changed files with 166 additions and 98 deletions
src/api/client_server

View file

@ -87,6 +87,13 @@ pub async fn search_events_route(
.timeline
.get_pdu_from_id(result)
.ok()?
.filter(|pdu| {
services()
.rooms
.state_accessor
.user_can_see_event(sender_user, &pdu.room_id, &pdu.event_id)
.unwrap_or(false)
})
.map(|pdu| pdu.to_room_event())
})
.map(|result| {