mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-10 17:03:20 -04:00
refactor(base): Remove SlidingSync::get_room.
This patch removes the `SlidingSync::get_room` method. The goal is to remove `SlidingSyncRoom`.
This commit is contained in:
@@ -394,8 +394,6 @@ async fn create_one_room(
|
||||
|
||||
assert!(update.rooms.contains(&room_id.to_owned()));
|
||||
|
||||
let _room = sliding_sync.get_room(room_id).await.context("`get_room`")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -404,9 +402,6 @@ async fn timeline_test_helper(
|
||||
sliding_sync: &SlidingSync,
|
||||
room_id: &RoomId,
|
||||
) -> Result<(Vector<Arc<TimelineItem>>, impl Stream<Item = Vec<VectorDiff<Arc<TimelineItem>>>>)> {
|
||||
let sliding_sync_room = sliding_sync.get_room(room_id).await.unwrap();
|
||||
|
||||
let room_id = sliding_sync_room.room_id();
|
||||
let sdk_room = client.get_room(room_id).ok_or_else(|| {
|
||||
anyhow::anyhow!("Room {room_id} not found in client. Can't provide a timeline for it")
|
||||
})?;
|
||||
|
||||
@@ -180,11 +180,6 @@ impl SlidingSync {
|
||||
}
|
||||
}
|
||||
|
||||
/// Lookup a specific room
|
||||
pub async fn get_room(&self, room_id: &RoomId) -> Option<SlidingSyncRoom> {
|
||||
self.inner.rooms.read().await.get(room_id).cloned()
|
||||
}
|
||||
|
||||
/// Check the number of rooms.
|
||||
pub fn get_number_of_rooms(&self) -> usize {
|
||||
self.inner.rooms.blocking_read().len()
|
||||
|
||||
Reference in New Issue
Block a user