diff --git a/bindings/matrix-sdk-ffi/src/room_list.rs b/bindings/matrix-sdk-ffi/src/room_list.rs index 48a6c10039..1d24c547f2 100644 --- a/bindings/matrix-sdk-ffi/src/room_list.rs +++ b/bindings/matrix-sdk-ffi/src/room_list.rs @@ -182,33 +182,6 @@ impl RoomList { }) } - fn entries(&self, listener: Box) -> Arc { - let this = self.inner.clone(); - let utd_hook = self.room_list_service.utd_hook.clone(); - - Arc::new(TaskHandle::new(RUNTIME.spawn(async move { - let (entries, entries_stream) = this.entries(); - - pin_mut!(entries_stream); - - listener.on_update(vec![RoomListEntriesUpdate::Append { - values: entries - .into_iter() - .map(|room| Arc::new(RoomListItem::from(room, utd_hook.clone()))) - .collect(), - }]); - - while let Some(diffs) = entries_stream.next().await { - listener.on_update( - diffs - .into_iter() - .map(|diff| RoomListEntriesUpdate::from(diff, utd_hook.clone())) - .collect(), - ); - } - }))) - } - fn entries_with_dynamic_adapters( self: Arc, page_size: u32, diff --git a/crates/matrix-sdk-ui/src/room_list_service/room_list.rs b/crates/matrix-sdk-ui/src/room_list_service/room_list.rs index de7b487027..6f9686bbf0 100644 --- a/crates/matrix-sdk-ui/src/room_list_service/room_list.rs +++ b/crates/matrix-sdk-ui/src/room_list_service/room_list.rs @@ -115,8 +115,8 @@ impl RoomList { self.loading_state.subscribe() } - /// Get all previous rooms, in addition to a [`Stream`] to rooms' updates. - pub fn entries(&self) -> (Vector, impl Stream>> + '_) { + /// Get a stream of rooms. + fn entries(&self) -> (Vector, impl Stream>> + '_) { let (rooms, stream) = self.client.rooms_stream(); let map_room = |room| Room::new(room, &self.sliding_sync); @@ -127,9 +127,11 @@ impl RoomList { ) } - /// Similar to [`Self::entries`] except that it's possible to provide a - /// filter that will filter out room list entries, and that it's also - /// possible to “paginate” over the entries by `page_size`. + /// Get a configurable stream of rooms. + /// + /// It's possible to provide a filter that will filter out room list + /// entries, and that it's also possible to “paginate” over the entries by + /// `page_size`. The rooms are also sorted. /// /// The returned stream will only start yielding diffs once a filter is set /// through the returned [`RoomListDynamicEntriesController`]. For every