File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
bindings/matrix-sdk-ffi/src/timeline
crates/matrix-sdk-ui/src/timeline Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ impl Timeline {
367367
368368 /// Returns the [`EventId`] of the latest event in the timeline.
369369 pub async fn latest_event_id ( & self ) -> Option < String > {
370- self . inner . latest_event ( ) . await . and_then ( |event| event . event_id ( ) . map ( ToString :: to_string) )
370+ self . inner . latest_event_id ( ) . await . as_deref ( ) . map ( ToString :: to_string)
371371 }
372372
373373 /// Queues an event in the room's send queue so it's processed for
Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ impl Timeline {
253253 Some ( item. to_owned ( ) )
254254 }
255255
256- /// Get the latest of the timeline's event items.
256+ /// Get the latest of the timeline's event items, both remote and local .
257257 pub async fn latest_event ( & self ) -> Option < EventTimelineItem > {
258258 if self . controller . is_live ( ) {
259259 self . controller . items ( ) . await . iter ( ) . rev ( ) . find_map ( |item| {
@@ -268,6 +268,11 @@ impl Timeline {
268268 }
269269 }
270270
271+ /// Get the latest of the timeline's event ids.
272+ pub async fn latest_event_id ( & self ) -> Option < OwnedEventId > {
273+ self . controller . latest_event_id ( ) . await
274+ }
275+
271276 /// Get the current timeline items, along with a stream of updates of
272277 /// timeline items.
273278 ///
You can’t perform that action at this time.
0 commit comments