base: Track new users we get from the room/members call.
parent
c1383402ed
commit
e84d3b9950
|
@ -1468,7 +1468,6 @@ impl Client {
|
||||||
self.send(request).await
|
self.send(request).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
async fn room_members(&self, room_id: &RoomId) -> Result<()> {
|
async fn room_members(&self, room_id: &RoomId) -> Result<()> {
|
||||||
let request = get_member_events::Request::new(room_id);
|
let request = get_member_events::Request::new(room_id);
|
||||||
let response = self.send(request).await?;
|
let response = self.send(request).await?;
|
||||||
|
|
|
@ -605,8 +605,6 @@ impl BaseClient {
|
||||||
|
|
||||||
let mut changes = StateChanges::default();
|
let mut changes = StateChanges::default();
|
||||||
|
|
||||||
changes.add_room(summary);
|
|
||||||
|
|
||||||
// TODO make sure we don't overwrite memership events from a sync.
|
// TODO make sure we don't overwrite memership events from a sync.
|
||||||
for e in &response.chunk {
|
for e in &response.chunk {
|
||||||
if let Ok(event) = hoist_member_event(e) {
|
if let Ok(event) = hoist_member_event(e) {
|
||||||
|
@ -623,6 +621,21 @@ impl BaseClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "encryption")]
|
||||||
|
if summary.is_encrypted() {
|
||||||
|
if let Some(o) = self.olm_machine().await {
|
||||||
|
if let Some(users) = changes.joined_user_ids.get(room_id) {
|
||||||
|
o.update_tracked_users(users).await
|
||||||
|
}
|
||||||
|
|
||||||
|
if let Some(users) = changes.invited_user_ids.get(room_id) {
|
||||||
|
o.update_tracked_users(users).await
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
changes.add_room(summary);
|
||||||
|
|
||||||
self.store.save_changes(&changes).await;
|
self.store.save_changes(&changes).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue