mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-04-26 10:11:10 -04:00
ffi: get rid of Room::poll_history as it's slow and likely unused
It's super slow (as it recreates and backpaginates from the start again) and unused in both EX apps, which are our main FFI embedders.
This commit is contained in:
@@ -150,10 +150,6 @@ impl Room {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn poll_history(&self) -> Result<Arc<Timeline>, ClientError> {
|
||||
Ok(Timeline::new(self.inner.poll_history().await?))
|
||||
}
|
||||
|
||||
pub fn display_name(&self) -> Result<String, ClientError> {
|
||||
let r = self.inner.clone();
|
||||
RUNTIME.block_on(async move { Ok(r.display_name().await?.to_string()) })
|
||||
|
||||
@@ -18,16 +18,13 @@ use matrix_sdk::Room;
|
||||
#[cfg(feature = "e2e-encryption")]
|
||||
use matrix_sdk::{deserialized_responses::TimelineEvent, Result};
|
||||
use matrix_sdk_base::latest_event::LatestEvent;
|
||||
#[cfg(feature = "e2e-encryption")]
|
||||
use ruma::{events::AnySyncTimelineEvent, serde::Raw};
|
||||
use ruma::{
|
||||
events::{
|
||||
receipt::{Receipt, ReceiptThread, ReceiptType},
|
||||
AnySyncMessageLikeEvent,
|
||||
},
|
||||
events::receipt::{Receipt, ReceiptThread, ReceiptType},
|
||||
push::{PushConditionRoomCtx, Ruleset},
|
||||
EventId, OwnedEventId, OwnedUserId, RoomVersionId, UserId,
|
||||
};
|
||||
#[cfg(feature = "e2e-encryption")]
|
||||
use ruma::{events::AnySyncTimelineEvent, serde::Raw};
|
||||
use tracing::{debug, error, warn};
|
||||
|
||||
use super::{Profile, TimelineBuilder};
|
||||
@@ -53,9 +50,6 @@ pub trait RoomExt {
|
||||
/// This allows to customize settings of the [`Timeline`] before
|
||||
/// constructing it.
|
||||
fn timeline_builder(&self) -> TimelineBuilder;
|
||||
|
||||
/// Get a [`Timeline`] for this room, filtered to only include poll events.
|
||||
async fn poll_history(&self) -> crate::event_graph::Result<Timeline>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
@@ -67,22 +61,6 @@ impl RoomExt for Room {
|
||||
fn timeline_builder(&self) -> TimelineBuilder {
|
||||
Timeline::builder(self).track_read_marker_and_receipts()
|
||||
}
|
||||
|
||||
async fn poll_history(&self) -> crate::event_graph::Result<Timeline> {
|
||||
self.timeline_builder()
|
||||
.event_filter(|e, _| {
|
||||
matches!(
|
||||
e,
|
||||
AnySyncTimelineEvent::MessageLike(
|
||||
AnySyncMessageLikeEvent::UnstablePollStart(_)
|
||||
| AnySyncMessageLikeEvent::UnstablePollResponse(_)
|
||||
| AnySyncMessageLikeEvent::UnstablePollEnd(_)
|
||||
)
|
||||
)
|
||||
})
|
||||
.build()
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
|
||||
Reference in New Issue
Block a user