@@ -277,31 +277,31 @@ impl TryFrom<MessageType> for RumaMessageType {
277
277
RumaImageMessageEventContent :: new ( content. body , ( * content. source ) . clone ( ) )
278
278
. info ( content. info . map ( Into :: into) . map ( Box :: new) ) ;
279
279
event_content. formatted = content. formatted . map ( Into :: into) ;
280
- event_content. filename = content. filename ;
280
+ event_content. filename = Some ( content. filename ) ;
281
281
Self :: Image ( event_content)
282
282
}
283
283
MessageType :: Audio { content } => {
284
284
let mut event_content =
285
285
RumaAudioMessageEventContent :: new ( content. body , ( * content. source ) . clone ( ) )
286
286
. info ( content. info . map ( Into :: into) . map ( Box :: new) ) ;
287
287
event_content. formatted = content. formatted . map ( Into :: into) ;
288
- event_content. filename = content. filename ;
288
+ event_content. filename = Some ( content. filename ) ;
289
289
Self :: Audio ( event_content)
290
290
}
291
291
MessageType :: Video { content } => {
292
292
let mut event_content =
293
293
RumaVideoMessageEventContent :: new ( content. body , ( * content. source ) . clone ( ) )
294
294
. info ( content. info . map ( Into :: into) . map ( Box :: new) ) ;
295
295
event_content. formatted = content. formatted . map ( Into :: into) ;
296
- event_content. filename = content. filename ;
296
+ event_content. filename = Some ( content. filename ) ;
297
297
Self :: Video ( event_content)
298
298
}
299
299
MessageType :: File { content } => {
300
300
let mut event_content =
301
301
RumaFileMessageEventContent :: new ( content. body , ( * content. source ) . clone ( ) )
302
302
. info ( content. info . map ( Into :: into) . map ( Box :: new) ) ;
303
303
event_content. formatted = content. formatted . map ( Into :: into) ;
304
- event_content. filename = content. filename ;
304
+ event_content. filename = Some ( content. filename ) ;
305
305
Self :: File ( event_content)
306
306
}
307
307
MessageType :: Notice { content } => {
@@ -337,7 +337,8 @@ impl From<RumaMessageType> for MessageType {
337
337
content : ImageMessageContent {
338
338
body : c. body . clone ( ) ,
339
339
formatted : c. formatted . as_ref ( ) . map ( Into :: into) ,
340
- filename : c. filename . clone ( ) ,
340
+ filename : c. filename ( ) . to_owned ( ) ,
341
+ caption : c. caption ( ) . map ( ToString :: to_string) ,
341
342
source : Arc :: new ( c. source . clone ( ) ) ,
342
343
info : c. info . as_deref ( ) . map ( Into :: into) ,
343
344
} ,
@@ -346,7 +347,8 @@ impl From<RumaMessageType> for MessageType {
346
347
content : AudioMessageContent {
347
348
body : c. body . clone ( ) ,
348
349
formatted : c. formatted . as_ref ( ) . map ( Into :: into) ,
349
- filename : c. filename . clone ( ) ,
350
+ filename : c. filename ( ) . to_owned ( ) ,
351
+ caption : c. caption ( ) . map ( ToString :: to_string) ,
350
352
source : Arc :: new ( c. source . clone ( ) ) ,
351
353
info : c. info . as_deref ( ) . map ( Into :: into) ,
352
354
audio : c. audio . map ( Into :: into) ,
@@ -357,7 +359,8 @@ impl From<RumaMessageType> for MessageType {
357
359
content : VideoMessageContent {
358
360
body : c. body . clone ( ) ,
359
361
formatted : c. formatted . as_ref ( ) . map ( Into :: into) ,
360
- filename : c. filename . clone ( ) ,
362
+ filename : c. filename ( ) . to_owned ( ) ,
363
+ caption : c. caption ( ) . map ( ToString :: to_string) ,
361
364
source : Arc :: new ( c. source . clone ( ) ) ,
362
365
info : c. info . as_deref ( ) . map ( Into :: into) ,
363
366
} ,
@@ -366,7 +369,8 @@ impl From<RumaMessageType> for MessageType {
366
369
content : FileMessageContent {
367
370
body : c. body . clone ( ) ,
368
371
formatted : c. formatted . as_ref ( ) . map ( Into :: into) ,
369
- filename : c. filename . clone ( ) ,
372
+ filename : c. filename ( ) . to_owned ( ) ,
373
+ caption : c. caption ( ) . map ( ToString :: to_string) ,
370
374
source : Arc :: new ( c. source . clone ( ) ) ,
371
375
info : c. info . as_deref ( ) . map ( Into :: into) ,
372
376
} ,
@@ -442,7 +446,8 @@ pub struct EmoteMessageContent {
442
446
pub struct ImageMessageContent {
443
447
pub body : String ,
444
448
pub formatted : Option < FormattedBody > ,
445
- pub filename : Option < String > ,
449
+ pub filename : String ,
450
+ pub caption : Option < String > ,
446
451
pub source : Arc < MediaSource > ,
447
452
pub info : Option < ImageInfo > ,
448
453
}
@@ -451,7 +456,8 @@ pub struct ImageMessageContent {
451
456
pub struct AudioMessageContent {
452
457
pub body : String ,
453
458
pub formatted : Option < FormattedBody > ,
454
- pub filename : Option < String > ,
459
+ pub filename : String ,
460
+ pub caption : Option < String > ,
455
461
pub source : Arc < MediaSource > ,
456
462
pub info : Option < AudioInfo > ,
457
463
pub audio : Option < UnstableAudioDetailsContent > ,
@@ -462,7 +468,8 @@ pub struct AudioMessageContent {
462
468
pub struct VideoMessageContent {
463
469
pub body : String ,
464
470
pub formatted : Option < FormattedBody > ,
465
- pub filename : Option < String > ,
471
+ pub filename : String ,
472
+ pub caption : Option < String > ,
466
473
pub source : Arc < MediaSource > ,
467
474
pub info : Option < VideoInfo > ,
468
475
}
@@ -471,7 +478,8 @@ pub struct VideoMessageContent {
471
478
pub struct FileMessageContent {
472
479
pub body : String ,
473
480
pub formatted : Option < FormattedBody > ,
474
- pub filename : Option < String > ,
481
+ pub filename : String ,
482
+ pub caption : Option < String > ,
475
483
pub source : Arc < MediaSource > ,
476
484
pub info : Option < FileInfo > ,
477
485
}
0 commit comments