fix(ui): SlidingSync::subscribe_to_room marks room as having missing members.

Fix https://github.com/matrix-org/matrix-rust-sdk/issues/2004.
This commit is contained in:
Ivan Enderlin
2023-06-16 09:44:36 +02:00
parent 31d834048f
commit 3a70b2e8ab
2 changed files with 13 additions and 1 deletions

View File

@@ -146,6 +146,11 @@ impl Room {
self.inner.read().unwrap().members_synced
}
/// Mark this Room is still missing member information.
pub fn mark_members_missing(&self) {
self.inner.write().unwrap().mark_members_missing()
}
/// Check if the room states have been synced
///
/// States might be missing if we have only seen the room_id of this Room
@@ -680,7 +685,7 @@ impl RoomInfo {
self.members_synced = true;
}
/// Mark this Room still missing member information.
/// Mark this Room is still missing member information.
pub fn mark_members_missing(&mut self) {
self.members_synced = false;
}

View File

@@ -134,7 +134,14 @@ impl SlidingSync {
}
/// Subscribe to a given room.
///
/// If the associated [`Room`] exists, it will be marked as members are
/// missing, so that it ensures to re-fetch all members.
pub fn subscribe_to_room(&self, room_id: OwnedRoomId, settings: Option<v4::RoomSubscription>) {
if let Some(room) = self.inner.client.get_room(&room_id) {
room.mark_members_missing();
}
self.inner
.sticky
.write()