From 30c401ac75dca5e7c083fc96f45aa1637e19d8c8 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Mon, 22 Jul 2024 11:11:15 +0200 Subject: [PATCH] timeline: rename `item_by_transaction_id` to `local_item_by_transaction_id` --- bindings/matrix-sdk-ffi/src/timeline/mod.rs | 2 +- crates/matrix-sdk-ui/CHANGELOG.md | 2 ++ crates/matrix-sdk-ui/src/timeline/mod.rs | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bindings/matrix-sdk-ffi/src/timeline/mod.rs b/bindings/matrix-sdk-ffi/src/timeline/mod.rs index b292d7bc46d..8ad1df9585c 100644 --- a/bindings/matrix-sdk-ffi/src/timeline/mod.rs +++ b/bindings/matrix-sdk-ffi/src/timeline/mod.rs @@ -581,7 +581,7 @@ impl Timeline { let transaction_id: OwnedTransactionId = transaction_id.into(); let item = self .inner - .item_by_transaction_id(&transaction_id) + .local_item_by_transaction_id(&transaction_id) .await .context("Item with given transaction ID not found")?; Ok(Arc::new(EventTimelineItem(item))) diff --git a/crates/matrix-sdk-ui/CHANGELOG.md b/crates/matrix-sdk-ui/CHANGELOG.md index ba88d8b130a..6945684010a 100644 --- a/crates/matrix-sdk-ui/CHANGELOG.md +++ b/crates/matrix-sdk-ui/CHANGELOG.md @@ -5,6 +5,8 @@ Breaking changes: - `Timeline::edit` now takes a `RoomMessageEventContentWithoutRelation`. - `Timeline::send_attachment` now takes an `impl Into` for the path of the file to send. +- `Timeline::item_by_transaction_id` has been renamed to `Timeline::local_item_by_transaction_id` +(always returns local echoes). Bug fixes: diff --git a/crates/matrix-sdk-ui/src/timeline/mod.rs b/crates/matrix-sdk-ui/src/timeline/mod.rs index ca975b2af4b..fba32304154 100644 --- a/crates/matrix-sdk-ui/src/timeline/mod.rs +++ b/crates/matrix-sdk-ui/src/timeline/mod.rs @@ -261,14 +261,15 @@ impl Timeline { Some(item.to_owned()) } - /// Get the current timeline item for the given transaction ID, if any. + /// Get the current local echo timeline item for the given transaction ID, + /// if any. /// /// This will always return a local echo, if found. /// /// 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 item_by_transaction_id( + pub async fn local_item_by_transaction_id( &self, target: &TransactionId, ) -> Option {