1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2025-06-27 16:35:59 +00:00

feat: Implement backfill joined/invited checks for private history

Co-authored-by: Nyaaori <+@nyaaori.cat>
This commit is contained in:
Andrei Vasiliu 2022-01-22 18:26:28 +02:00 committed by Nyaaori
parent ed64b528c1
commit 711e03b799
No known key found for this signature in database
GPG key ID: E7819C3ED4D1F82E
5 changed files with 181 additions and 49 deletions

View file

@ -1048,12 +1048,12 @@ fn get_missing_events(
sender_servername: &ServerName,
room_id: &RoomId,
earliest_events: &[OwnedEventId],
latest_events: &Vec<OwnedEventId>,
latest_events: &[OwnedEventId],
limit: UInt,
) -> Result<Vec<Box<RawJsonValue>>> {
let limit = u64::from(limit) as usize;
let mut queued_events = latest_events.clone();
let mut queued_events = latest_events.to_owned();
let mut events = Vec::new();
let mut stop_at_events = HashSet::with_capacity(limit);
@ -1086,10 +1086,11 @@ fn get_missing_events(
));
}
let event_is_visible = services()
.rooms
.state_accessor
.server_can_see_event(sender_servername, &queued_events[i])?;
let event_is_visible = services().rooms.state_accessor.server_can_see_event(
sender_servername,
room_id,
&queued_events[i],
)?;
if !event_is_visible {
i += 1;