From dc2775e1948ad1c543921633e5d4cf9797aa4e39 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Wed, 8 Jan 2025 11:44:45 +0100 Subject: [PATCH] chore!(ffi): rename `thumbnail_url` to `thumbnail_path` This is a breaking change because uniffi may use foreign-language named parameters based on the Rust parameter name. --- bindings/matrix-sdk-ffi/src/timeline/mod.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bindings/matrix-sdk-ffi/src/timeline/mod.rs b/bindings/matrix-sdk-ffi/src/timeline/mod.rs index a18d1b178a5..5773717714b 100644 --- a/bindings/matrix-sdk-ffi/src/timeline/mod.rs +++ b/bindings/matrix-sdk-ffi/src/timeline/mod.rs @@ -152,15 +152,15 @@ impl Timeline { } fn build_thumbnail_info( - thumbnail_url: Option, + thumbnail_path: Option, thumbnail_info: Option, ) -> Result, RoomError> { - match (thumbnail_url, thumbnail_info) { + match (thumbnail_path, thumbnail_info) { (None, None) => Ok(None), - (Some(thumbnail_url), Some(thumbnail_info)) => { + (Some(thumbnail_path), Some(thumbnail_info)) => { let thumbnail_data = - fs::read(thumbnail_url).map_err(|_| RoomError::InvalidThumbnailData)?; + fs::read(thumbnail_path).map_err(|_| RoomError::InvalidThumbnailData)?; let height = thumbnail_info .height @@ -190,7 +190,7 @@ fn build_thumbnail_info( } _ => { - warn!("Ignoring thumbnail because either the thumbnail URL or info isn't defined"); + warn!("Ignoring thumbnail because either the thumbnail path or info isn't defined"); Ok(None) } } @@ -326,14 +326,14 @@ impl Timeline { pub fn send_image( self: Arc, params: UploadParameters, - thumbnail_url: Option, + thumbnail_path: Option, image_info: ImageInfo, progress_watcher: Option>, ) -> Result, RoomError> { let attachment_info = AttachmentInfo::Image( BaseImageInfo::try_from(&image_info).map_err(|_| RoomError::InvalidAttachmentData)?, ); - let thumbnail = build_thumbnail_info(thumbnail_url, image_info.thumbnail_info)?; + let thumbnail = build_thumbnail_info(thumbnail_path, image_info.thumbnail_info)?; self.send_attachment( params, attachment_info, @@ -346,14 +346,14 @@ impl Timeline { pub fn send_video( self: Arc, params: UploadParameters, - thumbnail_url: Option, + thumbnail_path: Option, video_info: VideoInfo, progress_watcher: Option>, ) -> Result, RoomError> { let attachment_info = AttachmentInfo::Video( BaseVideoInfo::try_from(&video_info).map_err(|_| RoomError::InvalidAttachmentData)?, ); - let thumbnail = build_thumbnail_info(thumbnail_url, video_info.thumbnail_info)?; + let thumbnail = build_thumbnail_info(thumbnail_path, video_info.thumbnail_info)?; self.send_attachment( params, attachment_info,