mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-15 11:36:07 -04:00
fix(ffi): RoomListItem::full_room returns a Room with a Timeline.
This commit is contained in:
@@ -241,7 +241,7 @@ impl Room {
|
||||
|
||||
let listener: Arc<dyn TimelineListener> = listener.into();
|
||||
let timeline_stream =
|
||||
Arc::new(TaskHandle::new(RUNTIME.spawn(timeline_stream.for_each(move |diff| {
|
||||
TaskHandle::new(RUNTIME.spawn(timeline_stream.for_each(move |diff| {
|
||||
let listener = listener.clone();
|
||||
let fut = RUNTIME.spawn_blocking(move || {
|
||||
listener.on_update(Arc::new(TimelineDiff::new(diff)))
|
||||
@@ -252,11 +252,11 @@ impl Room {
|
||||
error!("Timeline listener error: {e}");
|
||||
}
|
||||
}
|
||||
}))));
|
||||
})));
|
||||
|
||||
RoomTimelineListenerResult {
|
||||
items: timeline_items.into_iter().map(TimelineItem::from_arc).collect(),
|
||||
items_stream: timeline_stream,
|
||||
items_stream: Arc::new(timeline_stream),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
use std::{fmt::Debug, sync::Arc};
|
||||
use std::{
|
||||
fmt::Debug,
|
||||
sync::{Arc, RwLock},
|
||||
};
|
||||
|
||||
use eyeball_im::VectorDiff;
|
||||
use futures_util::{pin_mut, StreamExt};
|
||||
@@ -203,7 +206,10 @@ impl RoomListItem {
|
||||
}
|
||||
|
||||
fn full_room(&self) -> Arc<Room> {
|
||||
Arc::new(Room::new(self.inner.inner_room().clone()))
|
||||
Arc::new(Room::with_timeline(
|
||||
self.inner.inner_room().clone(),
|
||||
Arc::new(RwLock::new(Some(RUNTIME.block_on(async { self.inner.timeline().await })))),
|
||||
))
|
||||
}
|
||||
|
||||
fn subscribe(&self, settings: Option<RoomSubscription>) {
|
||||
|
||||
Reference in New Issue
Block a user