timeline: rename item_by_transaction_id to local_item_by_transaction_id

This commit is contained in:
Benjamin Bouvier
2024-07-22 11:11:15 +02:00
parent bbae5364b3
commit 30c401ac75
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -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)))
+2
View File
@@ -5,6 +5,8 @@ Breaking changes:
- `Timeline::edit` now takes a `RoomMessageEventContentWithoutRelation`.
- `Timeline::send_attachment` now takes an `impl Into<PathBuf>` 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:
+3 -2
View File
@@ -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<EventTimelineItem> {