base: Remove an aditional looping through the joined state events.

This commit is contained in:
Damir Jelić 2020-05-14 13:00:47 +02:00
parent c9d38cdedb
commit c0ff782ea3

View file

@ -732,6 +732,8 @@ impl BaseClient {
if self.receive_joined_state_event(&room_id, &e).await {
updated = true;
}
self.emit_state_event(&room_id, &e, RoomStateType::Joined)
.await;
}
}
@ -764,14 +766,6 @@ impl BaseClient {
.await
.set_unread_notice_count(&joined_room.unread_notifications);
// re looping is not ideal here
for event in &mut joined_room.state.events {
if let Ok(e) = event.deserialize() {
self.emit_state_event(&room_id, &e, RoomStateType::Joined)
.await;
}
}
for mut event in &mut joined_room.timeline.events {
let decrypted_event = {
let (decrypt_ev, timeline_update) = self