diff --git a/bindings/matrix-sdk-ffi/src/ruma.rs b/bindings/matrix-sdk-ffi/src/ruma.rs index 7072270d8e8..e842b06cbb9 100644 --- a/bindings/matrix-sdk-ffi/src/ruma.rs +++ b/bindings/matrix-sdk-ffi/src/ruma.rs @@ -277,7 +277,7 @@ impl TryFrom for RumaMessageType { RumaImageMessageEventContent::new(content.body, (*content.source).clone()) .info(content.info.map(Into::into).map(Box::new)); event_content.formatted = content.formatted.map(Into::into); - event_content.filename = content.filename; + event_content.filename = Some(content.filename); Self::Image(event_content) } MessageType::Audio { content } => { @@ -285,7 +285,7 @@ impl TryFrom for RumaMessageType { RumaAudioMessageEventContent::new(content.body, (*content.source).clone()) .info(content.info.map(Into::into).map(Box::new)); event_content.formatted = content.formatted.map(Into::into); - event_content.filename = content.filename; + event_content.filename = Some(content.filename); Self::Audio(event_content) } MessageType::Video { content } => { @@ -293,7 +293,7 @@ impl TryFrom for RumaMessageType { RumaVideoMessageEventContent::new(content.body, (*content.source).clone()) .info(content.info.map(Into::into).map(Box::new)); event_content.formatted = content.formatted.map(Into::into); - event_content.filename = content.filename; + event_content.filename = Some(content.filename); Self::Video(event_content) } MessageType::File { content } => { @@ -301,7 +301,7 @@ impl TryFrom for RumaMessageType { RumaFileMessageEventContent::new(content.body, (*content.source).clone()) .info(content.info.map(Into::into).map(Box::new)); event_content.formatted = content.formatted.map(Into::into); - event_content.filename = content.filename; + event_content.filename = Some(content.filename); Self::File(event_content) } MessageType::Notice { content } => { @@ -337,7 +337,8 @@ impl From for MessageType { content: ImageMessageContent { body: c.body.clone(), formatted: c.formatted.as_ref().map(Into::into), - filename: c.filename.clone(), + filename: c.filename().to_owned(), + caption: c.caption().map(ToString::to_string), source: Arc::new(c.source.clone()), info: c.info.as_deref().map(Into::into), }, @@ -346,7 +347,8 @@ impl From for MessageType { content: AudioMessageContent { body: c.body.clone(), formatted: c.formatted.as_ref().map(Into::into), - filename: c.filename.clone(), + filename: c.filename().to_owned(), + caption: c.caption().map(ToString::to_string), source: Arc::new(c.source.clone()), info: c.info.as_deref().map(Into::into), audio: c.audio.map(Into::into), @@ -357,7 +359,8 @@ impl From for MessageType { content: VideoMessageContent { body: c.body.clone(), formatted: c.formatted.as_ref().map(Into::into), - filename: c.filename.clone(), + filename: c.filename().to_owned(), + caption: c.caption().map(ToString::to_string), source: Arc::new(c.source.clone()), info: c.info.as_deref().map(Into::into), }, @@ -366,7 +369,8 @@ impl From for MessageType { content: FileMessageContent { body: c.body.clone(), formatted: c.formatted.as_ref().map(Into::into), - filename: c.filename.clone(), + filename: c.filename().to_owned(), + caption: c.caption().map(ToString::to_string), source: Arc::new(c.source.clone()), info: c.info.as_deref().map(Into::into), }, @@ -442,7 +446,8 @@ pub struct EmoteMessageContent { pub struct ImageMessageContent { pub body: String, pub formatted: Option, - pub filename: Option, + pub filename: String, + pub caption: Option, pub source: Arc, pub info: Option, } @@ -451,7 +456,8 @@ pub struct ImageMessageContent { pub struct AudioMessageContent { pub body: String, pub formatted: Option, - pub filename: Option, + pub filename: String, + pub caption: Option, pub source: Arc, pub info: Option, pub audio: Option, @@ -462,7 +468,8 @@ pub struct AudioMessageContent { pub struct VideoMessageContent { pub body: String, pub formatted: Option, - pub filename: Option, + pub filename: String, + pub caption: Option, pub source: Arc, pub info: Option, } @@ -471,7 +478,8 @@ pub struct VideoMessageContent { pub struct FileMessageContent { pub body: String, pub formatted: Option, - pub filename: Option, + pub filename: String, + pub caption: Option, pub source: Arc, pub info: Option, }