File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
bindings/matrix-sdk-ffi/src/timeline Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -418,15 +418,22 @@ impl Timeline {
418
418
self : Arc < Self > ,
419
419
url : String ,
420
420
file_info : FileInfo ,
421
+ caption : Option < String > ,
422
+ formatted_caption : Option < FormattedBody > ,
421
423
progress_watcher : Option < Box < dyn ProgressWatcher > > ,
422
424
use_send_queue : bool ,
423
425
) -> Arc < SendAttachmentJoinHandle > {
426
+ let formatted_caption =
427
+ formatted_body_from ( caption. as_deref ( ) , formatted_caption. map ( Into :: into) ) ;
424
428
SendAttachmentJoinHandle :: new ( RUNTIME . spawn ( async move {
425
429
let base_file_info: BaseFileInfo =
426
430
BaseFileInfo :: try_from ( & file_info) . map_err ( |_| RoomError :: InvalidAttachmentData ) ?;
427
431
let attachment_info = AttachmentInfo :: File ( base_file_info) ;
428
432
429
- let attachment_config = AttachmentConfig :: new ( ) . info ( attachment_info) ;
433
+ let attachment_config = AttachmentConfig :: new ( )
434
+ . info ( attachment_info)
435
+ . caption ( caption)
436
+ . formatted_caption ( formatted_caption. map ( Into :: into) ) ;
430
437
431
438
self . send_attachment (
432
439
url,
You can’t perform that action at this time.
0 commit comments