From a562f73b1eeffe2cf39ac86118e0043bc80d6090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Tue, 10 Dec 2024 13:05:17 +0100 Subject: [PATCH] doc(timeline): Document media caching of send_attachment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- crates/matrix-sdk-ui/src/timeline/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/matrix-sdk-ui/src/timeline/mod.rs b/crates/matrix-sdk-ui/src/timeline/mod.rs index 61fc7824c..9a9623e3f 100644 --- a/crates/matrix-sdk-ui/src/timeline/mod.rs +++ b/crates/matrix-sdk-ui/src/timeline/mod.rs @@ -532,6 +532,12 @@ impl Timeline { /// If the encryption feature is enabled, this method will transparently /// encrypt the room message if the room is encrypted. /// + /// The attachment and its optional thumbnail are stored in the media cache + /// and can be retrieved at any time, by calling + /// [`Media::get_media_content()`] with the `MediaSource` that can be found + /// in the corresponding `TimelineEventItem`, and using a + /// `MediaFormat::File`. + /// /// # Arguments /// /// * `path` - The path of the file to be sent. @@ -540,6 +546,8 @@ impl Timeline { /// /// * `config` - An attachment configuration object containing details about /// the attachment like a thumbnail, its size, duration etc. + /// + /// [`Media::get_media_content()`]: matrix_sdk::Media::get_media_content #[instrument(skip_all)] pub fn send_attachment( &self,