Skip to content

Commit

Permalink
fix(ui): SlidingSync::subscribe_to_room marks room as having missin…
Browse files Browse the repository at this point in the history
…g members.

Fix matrix-org#2004.
  • Loading branch information
Hywan committed Jun 16, 2023
1 parent 31d8340 commit 3a70b2e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/matrix-sdk-base/src/rooms/normal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
7 changes: 7 additions & 0 deletions crates/matrix-sdk/src/sliding_sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3a70b2e

Please sign in to comment.