Skip to content

Commit

Permalink
refactor(ffi): get rid of get_event_timeline_item_by_event_id
Browse files Browse the repository at this point in the history
This should be unused too. We can't plain get rid of the SDK equivalent,
because it's still used in two places in the context of replies.
  • Loading branch information
bnjbvr committed Oct 15, 2024
1 parent d603169 commit c130eb7
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions bindings/matrix-sdk-ffi/src/timeline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ use ruma::{
},
AnyMessageLikeEventContent,
},
EventId, OwnedTransactionId,
EventId,
};
use tokio::{
sync::Mutex,
Expand Down Expand Up @@ -555,27 +555,6 @@ impl Timeline {
Ok(())
}

/// Get the current timeline item for the given event ID, if any.
///
/// Will return a remote event, *or* a local echo that has been sent but not
/// yet replaced by a remote echo.
///
/// It's preferable to store the timeline items in the model for your UI, if
/// possible, instead of just storing IDs and coming back to the timeline
/// object to look up items.
pub async fn get_event_timeline_item_by_event_id(
&self,
event_id: String,
) -> Result<EventTimelineItem, ClientError> {
let event_id = EventId::parse(event_id)?;
let item = self
.inner
.item_by_event_id(&event_id)
.await
.context("Item with given event ID not found")?;
Ok(item.into())
}

/// Redacts an event from the timeline.
///
/// Only works for events that exist as timeline items.
Expand Down

0 comments on commit c130eb7

Please sign in to comment.