base: Only update the tracked users when we're done with the state and timeline.
This commit is contained in:
parent
f33298b1a6
commit
98d36d0ef0
1 changed files with 15 additions and 15 deletions
|
@ -990,21 +990,6 @@ impl BaseClient {
|
|||
self.get_or_create_joined_room(&room_id).await?.clone()
|
||||
};
|
||||
|
||||
#[cfg(feature = "encryption")]
|
||||
{
|
||||
let mut olm = self.olm.lock().await;
|
||||
|
||||
if let Some(o) = &mut *olm {
|
||||
let room = matrix_room.read().await;
|
||||
|
||||
// If the room is encrypted, update the tracked users.
|
||||
if room.is_encrypted() {
|
||||
o.update_tracked_users(room.joined_members.keys()).await;
|
||||
o.update_tracked_users(room.invited_members.keys()).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// RoomSummary contains information for calculating room name.
|
||||
matrix_room
|
||||
.write()
|
||||
|
@ -1042,6 +1027,21 @@ impl BaseClient {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "encryption")]
|
||||
{
|
||||
let mut olm = self.olm.lock().await;
|
||||
|
||||
if let Some(o) = &mut *olm {
|
||||
let room = matrix_room.read().await;
|
||||
|
||||
// If the room is encrypted, update the tracked users.
|
||||
if room.is_encrypted() {
|
||||
o.update_tracked_users(room.joined_members.keys()).await;
|
||||
o.update_tracked_users(room.invited_members.keys()).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// look at AccountData to further cut down users by collecting ignored users
|
||||
if let Some(account_data) = &joined_room.account_data {
|
||||
for account_data in &account_data.events {
|
||||
|
|
Loading…
Reference in a new issue