improvement: more efficient /sync with gaps

This commit is contained in:
Timo Kösters 2020-09-17 14:44:47 +02:00
parent 506c2a3146
commit ea3aaa6b5c
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
10 changed files with 251 additions and 299 deletions

View file

@ -601,8 +601,7 @@ async fn join_room_by_id_helper(
.cloned()
.collect::<Vec<_>>();
let power_level =
resolved_control_events.get(&(EventType::RoomPowerLevels, Some("".into())));
let power_level = resolved_control_events.get(&(EventType::RoomPowerLevels, "".into()));
// Sort the remaining non control events
let sorted_event_ids = state_res::StateResolution::mainline_sort(
room_id,
@ -644,13 +643,7 @@ async fn join_room_by_id_helper(
)?;
if state_events.contains(ev_id) {
state.insert(
(
pdu.kind(),
pdu.state_key().expect("State events have a state key"),
),
pdu_id,
);
state.insert((pdu.kind(), pdu.state_key()), pdu_id);
}
}