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

master
Damir Jelić 2020-05-14 13:00:47 +02:00
parent c9d38cdedb
commit c0ff782ea3
1 changed files with 2 additions and 8 deletions

View File

@ -732,6 +732,8 @@ impl BaseClient {
if self.receive_joined_state_event(&room_id, &e).await { if self.receive_joined_state_event(&room_id, &e).await {
updated = true; updated = true;
} }
self.emit_state_event(&room_id, &e, RoomStateType::Joined)
.await;
} }
} }
@ -764,14 +766,6 @@ impl BaseClient {
.await .await
.set_unread_notice_count(&joined_room.unread_notifications); .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 { for mut event in &mut joined_room.timeline.events {
let decrypted_event = { let decrypted_event = {
let (decrypt_ev, timeline_update) = self let (decrypt_ev, timeline_update) = self