Skip to content

Commit a02cd60

Browse files
committed
change(ffi): remove the room's timeline method in favor of timeline_with_configuration
1 parent 3287304 commit a02cd60

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

bindings/matrix-sdk-ffi/src/room.rs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use matrix_sdk::{
1313
RoomHero as SdkRoomHero, RoomMemberships, RoomState,
1414
};
1515
use matrix_sdk_ui::{
16-
timeline::{default_event_filter, RoomExt, TimelineBuilder},
16+
timeline::{default_event_filter, TimelineBuilder},
1717
unable_to_decrypt_hook::UtdHookManager,
1818
};
1919
use mime::Mime;
@@ -31,7 +31,6 @@ use ruma::{
3131
},
3232
EventId, Int, OwnedDeviceId, OwnedUserId, RoomAliasId, UserId,
3333
};
34-
use tokio::sync::RwLock;
3534
use tracing::{error, warn};
3635

3736
use crate::{
@@ -73,18 +72,15 @@ impl From<RoomState> for Membership {
7372
}
7473
}
7574

76-
pub(crate) type TimelineLock = Arc<RwLock<Option<Arc<Timeline>>>>;
77-
7875
#[derive(uniffi::Object)]
7976
pub struct Room {
8077
pub(super) inner: SdkRoom,
8178
utd_hook_manager: Option<Arc<UtdHookManager>>,
82-
timeline: TimelineLock,
8379
}
8480

8581
impl Room {
8682
pub(crate) fn new(inner: SdkRoom, utd_hook_manager: Option<Arc<UtdHookManager>>) -> Self {
87-
Room { inner, timeline: Default::default(), utd_hook_manager }
83+
Room { inner, utd_hook_manager }
8884
}
8985
}
9086

@@ -173,17 +169,6 @@ impl Room {
173169
Ok(())
174170
}
175171

176-
pub async fn timeline(&self) -> Result<Arc<Timeline>, ClientError> {
177-
let mut write_guard = self.timeline.write().await;
178-
if let Some(timeline) = &*write_guard {
179-
Ok(timeline.clone())
180-
} else {
181-
let timeline = Timeline::new(self.inner.timeline().await?);
182-
*write_guard = Some(timeline.clone());
183-
Ok(timeline)
184-
}
185-
}
186-
187172
/// Build a new timeline instance with the given configuration.
188173
pub async fn timeline_with_configuration(
189174
&self,

0 commit comments

Comments
 (0)