mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-18 05:30:33 -04:00
chore(ui): Rename room_list module to room_list_service
chore(ui): Rename `room_list` module to `room_list_service`
This commit is contained in:
@@ -57,9 +57,9 @@ pub enum RoomListError {
|
||||
InvalidRoomId { error: String },
|
||||
}
|
||||
|
||||
impl From<matrix_sdk_ui::room_list::Error> for RoomListError {
|
||||
fn from(value: matrix_sdk_ui::room_list::Error) -> Self {
|
||||
use matrix_sdk_ui::room_list::Error::*;
|
||||
impl From<matrix_sdk_ui::room_list_service::Error> for RoomListError {
|
||||
fn from(value: matrix_sdk_ui::room_list_service::Error) -> Self {
|
||||
use matrix_sdk_ui::room_list_service::Error::*;
|
||||
|
||||
match value {
|
||||
SlidingSync(error) => Self::SlidingSync { error: error.to_string() },
|
||||
@@ -87,7 +87,7 @@ pub enum RoomListInput {
|
||||
Viewport { ranges: Vec<RoomListRange> },
|
||||
}
|
||||
|
||||
impl From<RoomListInput> for matrix_sdk_ui::room_list::Input {
|
||||
impl From<RoomListInput> for matrix_sdk_ui::room_list_service::Input {
|
||||
fn from(value: RoomListInput) -> Self {
|
||||
match value {
|
||||
RoomListInput::Viewport { ranges } => Self::Viewport(
|
||||
@@ -122,7 +122,7 @@ impl RoomListService {
|
||||
}
|
||||
|
||||
fn is_syncing(&self) -> bool {
|
||||
use matrix_sdk_ui::room_list::State;
|
||||
use matrix_sdk_ui::room_list_service::State;
|
||||
|
||||
matches!(self.inner.state().get(), State::SettingUp | State::Running)
|
||||
}
|
||||
@@ -172,7 +172,7 @@ impl RoomListService {
|
||||
#[derive(uniffi::Object)]
|
||||
pub struct RoomList {
|
||||
room_list_service: Arc<RoomListService>,
|
||||
inner: Arc<matrix_sdk_ui::room_list::RoomList>,
|
||||
inner: Arc<matrix_sdk_ui::room_list_service::RoomList>,
|
||||
}
|
||||
|
||||
#[uniffi::export]
|
||||
@@ -239,9 +239,9 @@ pub enum RoomListServiceState {
|
||||
Terminated,
|
||||
}
|
||||
|
||||
impl From<matrix_sdk_ui::room_list::State> for RoomListServiceState {
|
||||
fn from(value: matrix_sdk_ui::room_list::State) -> Self {
|
||||
use matrix_sdk_ui::room_list::State::*;
|
||||
impl From<matrix_sdk_ui::room_list_service::State> for RoomListServiceState {
|
||||
fn from(value: matrix_sdk_ui::room_list_service::State) -> Self {
|
||||
use matrix_sdk_ui::room_list_service::State::*;
|
||||
|
||||
match value {
|
||||
Init => Self::Init,
|
||||
@@ -259,9 +259,9 @@ pub enum RoomListLoadingState {
|
||||
Loaded { maximum_number_of_rooms: Option<u32> },
|
||||
}
|
||||
|
||||
impl From<matrix_sdk_ui::room_list::RoomListLoadingState> for RoomListLoadingState {
|
||||
fn from(value: matrix_sdk_ui::room_list::RoomListLoadingState) -> Self {
|
||||
use matrix_sdk_ui::room_list::RoomListLoadingState::*;
|
||||
impl From<matrix_sdk_ui::room_list_service::RoomListLoadingState> for RoomListLoadingState {
|
||||
fn from(value: matrix_sdk_ui::room_list_service::RoomListLoadingState) -> Self {
|
||||
use matrix_sdk_ui::room_list_service::RoomListLoadingState::*;
|
||||
|
||||
match value {
|
||||
NotLoaded => Self::NotLoaded,
|
||||
@@ -326,7 +326,7 @@ pub trait RoomListEntriesListener: Send + Sync + Debug {
|
||||
|
||||
#[derive(uniffi::Object)]
|
||||
pub struct RoomListItem {
|
||||
inner: Arc<matrix_sdk_ui::room_list::Room>,
|
||||
inner: Arc<matrix_sdk_ui::room_list_service::Room>,
|
||||
}
|
||||
|
||||
#[uniffi::export]
|
||||
|
||||
@@ -17,9 +17,9 @@ mod events;
|
||||
#[cfg(feature = "experimental-encryption-sync")]
|
||||
pub mod encryption_sync;
|
||||
#[cfg(feature = "experimental-room-list")]
|
||||
pub mod room_list;
|
||||
pub mod room_list_service;
|
||||
pub mod timeline;
|
||||
|
||||
#[cfg(feature = "experimental-room-list")]
|
||||
pub use self::room_list::RoomListService;
|
||||
pub use self::room_list_service::RoomListService;
|
||||
pub use self::timeline::Timeline;
|
||||
|
||||
@@ -63,7 +63,6 @@
|
||||
//! machine's state, which can be pretty helpful for the client app.
|
||||
|
||||
mod room;
|
||||
#[allow(clippy::module_inception)]
|
||||
mod room_list;
|
||||
mod state;
|
||||
|
||||
@@ -29,7 +29,7 @@ use wiremock::{
|
||||
#[cfg(feature = "experimental-encryption-sync")]
|
||||
mod encryption_sync;
|
||||
#[cfg(feature = "experimental-room-list")]
|
||||
mod room_list;
|
||||
mod room_list_service;
|
||||
mod sliding_sync;
|
||||
mod timeline;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ use futures_util::{pin_mut, FutureExt, StreamExt};
|
||||
use imbl::vector;
|
||||
use matrix_sdk_test::async_test;
|
||||
use matrix_sdk_ui::{
|
||||
room_list::{
|
||||
room_list_service::{
|
||||
Error, Input, InputResult, RoomListEntry, RoomListLoadingState, State,
|
||||
ALL_ROOMS_LIST_NAME as ALL_ROOMS, INVITES_LIST_NAME as INVITES,
|
||||
VISIBLE_ROOMS_LIST_NAME as VISIBLE_ROOMS,
|
||||
@@ -30,7 +30,7 @@ use crate::{
|
||||
timeline::sliding_sync::{assert_timeline_stream, timeline_event},
|
||||
};
|
||||
|
||||
async fn new_room_list() -> Result<(MockServer, RoomListService), Error> {
|
||||
async fn new_room_list_service() -> Result<(MockServer, RoomListService), Error> {
|
||||
let (client, server) = logged_in_client().await;
|
||||
let room_list = RoomListService::new(client).await?;
|
||||
|
||||
@@ -204,7 +204,7 @@ macro_rules! assert_entries_stream {
|
||||
|
||||
#[async_test]
|
||||
async fn test_sync_all_states() -> Result<(), Error> {
|
||||
let (server, room_list) = new_room_list().await?;
|
||||
let (server, room_list) = new_room_list_service().await?;
|
||||
|
||||
let sync = room_list.sync();
|
||||
pin_mut!(sync);
|
||||
@@ -450,7 +450,7 @@ async fn test_sync_all_states() -> Result<(), Error> {
|
||||
|
||||
#[async_test]
|
||||
async fn test_sync_resumes_from_previous_state() -> Result<(), Error> {
|
||||
let (server, room_list) = new_room_list().await?;
|
||||
let (server, room_list) = new_room_list_service().await?;
|
||||
|
||||
// Start a sync, and drop it at the end of the block.
|
||||
{
|
||||
@@ -569,7 +569,7 @@ async fn test_sync_resumes_from_previous_state() -> Result<(), Error> {
|
||||
|
||||
#[async_test]
|
||||
async fn test_sync_resumes_from_error() -> Result<(), Error> {
|
||||
let (server, room_list) = new_room_list().await?;
|
||||
let (server, room_list) = new_room_list_service().await?;
|
||||
|
||||
let sync = room_list.sync();
|
||||
pin_mut!(sync);
|
||||
@@ -870,7 +870,7 @@ async fn test_sync_resumes_from_error() -> Result<(), Error> {
|
||||
|
||||
#[async_test]
|
||||
async fn test_sync_resumes_from_terminated() -> Result<(), Error> {
|
||||
let (server, room_list) = new_room_list().await?;
|
||||
let (server, room_list) = new_room_list_service().await?;
|
||||
|
||||
// Let's stop the sync before actually syncing (we never know!).
|
||||
// We get an error, obviously.
|
||||
@@ -1109,7 +1109,7 @@ async fn test_sync_resumes_from_terminated() -> Result<(), Error> {
|
||||
|
||||
#[async_test]
|
||||
async fn test_loading_states() -> Result<(), Error> {
|
||||
let (server, room_list) = new_room_list().await?;
|
||||
let (server, room_list) = new_room_list_service().await?;
|
||||
|
||||
let sync = room_list.sync();
|
||||
pin_mut!(sync);
|
||||
@@ -1217,7 +1217,7 @@ async fn test_loading_states() -> Result<(), Error> {
|
||||
|
||||
#[async_test]
|
||||
async fn test_entries_stream() -> Result<(), Error> {
|
||||
let (server, room_list) = new_room_list().await?;
|
||||
let (server, room_list) = new_room_list_service().await?;
|
||||
|
||||
let sync = room_list.sync();
|
||||
pin_mut!(sync);
|
||||
@@ -1352,7 +1352,7 @@ async fn test_entries_stream() -> Result<(), Error> {
|
||||
|
||||
#[async_test]
|
||||
async fn test_entries_stream_with_updated_filter() -> Result<(), Error> {
|
||||
let (server, room_list) = new_room_list().await?;
|
||||
let (server, room_list) = new_room_list_service().await?;
|
||||
|
||||
let sync = room_list.sync();
|
||||
pin_mut!(sync);
|
||||
@@ -1493,7 +1493,7 @@ async fn test_entries_stream_with_updated_filter() -> Result<(), Error> {
|
||||
|
||||
#[async_test]
|
||||
async fn test_invites_stream() -> Result<(), Error> {
|
||||
let (server, room_list) = new_room_list().await?;
|
||||
let (server, room_list) = new_room_list_service().await?;
|
||||
|
||||
let sync = room_list.sync();
|
||||
pin_mut!(sync);
|
||||
@@ -1651,7 +1651,7 @@ async fn test_invites_stream() -> Result<(), Error> {
|
||||
|
||||
#[async_test]
|
||||
async fn test_room() -> Result<(), Error> {
|
||||
let (server, room_list) = new_room_list().await?;
|
||||
let (server, room_list) = new_room_list_service().await?;
|
||||
|
||||
let sync = room_list.sync();
|
||||
pin_mut!(sync);
|
||||
@@ -1734,7 +1734,7 @@ async fn test_room() -> Result<(), Error> {
|
||||
|
||||
#[async_test]
|
||||
async fn test_room_not_found() -> Result<(), Error> {
|
||||
let (_server, room_list) = new_room_list().await?;
|
||||
let (_server, room_list) = new_room_list_service().await?;
|
||||
|
||||
let room_id = room_id!("!foo:bar.org");
|
||||
|
||||
@@ -1750,7 +1750,7 @@ async fn test_room_not_found() -> Result<(), Error> {
|
||||
|
||||
#[async_test]
|
||||
async fn test_room_subscription() -> Result<(), Error> {
|
||||
let (server, room_list) = new_room_list().await?;
|
||||
let (server, room_list) = new_room_list_service().await?;
|
||||
|
||||
let sync = room_list.sync();
|
||||
pin_mut!(sync);
|
||||
@@ -1871,7 +1871,7 @@ async fn test_room_subscription() -> Result<(), Error> {
|
||||
|
||||
#[async_test]
|
||||
async fn test_room_unread_notifications() -> Result<(), Error> {
|
||||
let (server, room_list) = new_room_list().await?;
|
||||
let (server, room_list) = new_room_list_service().await?;
|
||||
|
||||
let sync = room_list.sync();
|
||||
pin_mut!(sync);
|
||||
@@ -1958,7 +1958,7 @@ async fn test_room_unread_notifications() -> Result<(), Error> {
|
||||
|
||||
#[async_test]
|
||||
async fn test_room_timeline() -> Result<(), Error> {
|
||||
let (server, room_list) = new_room_list().await?;
|
||||
let (server, room_list) = new_room_list_service().await?;
|
||||
|
||||
let sync = room_list.sync();
|
||||
pin_mut!(sync);
|
||||
@@ -2042,7 +2042,7 @@ async fn test_room_timeline() -> Result<(), Error> {
|
||||
|
||||
#[async_test]
|
||||
async fn test_room_latest_event() -> Result<(), Error> {
|
||||
let (server, room_list) = new_room_list().await?;
|
||||
let (server, room_list) = new_room_list_service().await?;
|
||||
|
||||
let sync = room_list.sync();
|
||||
pin_mut!(sync);
|
||||
@@ -2133,7 +2133,7 @@ async fn test_room_latest_event() -> Result<(), Error> {
|
||||
|
||||
#[async_test]
|
||||
async fn test_input_viewport() -> Result<(), Error> {
|
||||
let (server, room_list) = new_room_list().await?;
|
||||
let (server, room_list) = new_room_list_service().await?;
|
||||
|
||||
let sync = room_list.sync();
|
||||
pin_mut!(sync);
|
||||
Reference in New Issue
Block a user