From ca019aa517fdf347964ce2c4bc28f2d853afd315 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Wed, 8 Jan 2025 21:30:10 +0100 Subject: [PATCH 1/3] refactor(sdk): Un-cfg Client::rooms_stream It compiles on WASM too. --- crates/matrix-sdk/src/client/mod.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/crates/matrix-sdk/src/client/mod.rs b/crates/matrix-sdk/src/client/mod.rs index 22825062d60..033bb2ac69f 100644 --- a/crates/matrix-sdk/src/client/mod.rs +++ b/crates/matrix-sdk/src/client/mod.rs @@ -23,13 +23,9 @@ use std::{ }; use eyeball::{SharedObservable, Subscriber}; -#[cfg(not(target_arch = "wasm32"))] -use eyeball_im::VectorDiff; +use eyeball_im::{Vector, VectorDiff}; use futures_core::Stream; -#[cfg(not(target_arch = "wasm32"))] use futures_util::StreamExt; -#[cfg(not(target_arch = "wasm32"))] -use imbl::Vector; #[cfg(feature = "e2e-encryption")] use matrix_sdk_base::crypto::store::LockableCryptoStore; use matrix_sdk_base::{ @@ -1098,7 +1094,6 @@ impl Client { } /// Get a stream of all the rooms, in addition to the existing rooms. - #[cfg(not(target_arch = "wasm32"))] pub fn rooms_stream(&self) -> (Vector, impl Stream>> + '_) { let (rooms, stream) = self.base_client().rooms_stream(); From 7a4bd19fceecf796764384549cd50d03f38f2037 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Wed, 8 Jan 2025 21:20:21 +0100 Subject: [PATCH 2/3] refactor(ui): Fix unused import on wasm --- crates/matrix-sdk-ui/src/timeline/futures.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/matrix-sdk-ui/src/timeline/futures.rs b/crates/matrix-sdk-ui/src/timeline/futures.rs index 8109e0cb8c9..bba9799a60a 100644 --- a/crates/matrix-sdk-ui/src/timeline/futures.rs +++ b/crates/matrix-sdk-ui/src/timeline/futures.rs @@ -1,6 +1,6 @@ use std::future::IntoFuture; -use eyeball::{SharedObservable, Subscriber}; +use eyeball::SharedObservable; use matrix_sdk::{attachment::AttachmentConfig, TransmissionProgress}; use matrix_sdk_base::boxed_into_future; use mime::Mime; @@ -48,10 +48,9 @@ impl<'a> SendAttachment<'a> { Self { use_send_queue: true, ..self } } - /// Get a subscriber to observe the progress of sending the request - /// body. + /// Get a subscriber to observe the progress of sending the request body. #[cfg(not(target_arch = "wasm32"))] - pub fn subscribe_to_send_progress(&self) -> Subscriber { + pub fn subscribe_to_send_progress(&self) -> eyeball::Subscriber { self.send_progress.subscribe() } } From 61ac3a6d4cacd12b401dfceb53ac598cfbf191ff Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Wed, 8 Jan 2025 21:20:49 +0100 Subject: [PATCH 3/3] refactor(ui): Inherit Send / Sync bounds on RoomDataProvider from super traits --- crates/matrix-sdk-ui/src/timeline/traits.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/matrix-sdk-ui/src/timeline/traits.rs b/crates/matrix-sdk-ui/src/timeline/traits.rs index d4ad9bdf288..ac6e3aa02b1 100644 --- a/crates/matrix-sdk-ui/src/timeline/traits.rs +++ b/crates/matrix-sdk-ui/src/timeline/traits.rs @@ -71,7 +71,7 @@ impl RoomExt for Room { } pub(super) trait RoomDataProvider: - Clone + Send + Sync + 'static + PaginableRoom + PinnedEventsRoom + Clone + PaginableRoom + PinnedEventsRoom + 'static { fn own_user_id(&self) -> &UserId; fn room_version(&self) -> RoomVersionId;