@@ -34,7 +34,7 @@ use ruma::{
34
34
MessageType as RumaMessageType ,
35
35
NoticeMessageEventContent as RumaNoticeMessageEventContent ,
36
36
RoomMessageEventContentWithoutRelation ,
37
- TextMessageEventContent as RumaTextMessageEventContent ,
37
+ TextMessageEventContent as RumaTextMessageEventContent , UnstableAmplitude ,
38
38
UnstableAudioDetailsContentBlock as RumaUnstableAudioDetailsContentBlock ,
39
39
UnstableVoiceContentBlock as RumaUnstableVoiceContentBlock ,
40
40
VideoInfo as RumaVideoInfo ,
@@ -362,6 +362,8 @@ impl TryFrom<MessageType> for RumaMessageType {
362
362
. info ( content. info . map ( Into :: into) . map ( Box :: new) ) ;
363
363
event_content. formatted = content. formatted_caption . map ( Into :: into) ;
364
364
event_content. filename = filename;
365
+ event_content. audio = content. audio . map ( Into :: into) ;
366
+ event_content. voice = content. voice . map ( Into :: into) ;
365
367
Self :: Audio ( event_content)
366
368
}
367
369
MessageType :: Video { content } => {
@@ -658,6 +660,15 @@ impl From<RumaUnstableAudioDetailsContentBlock> for UnstableAudioDetailsContent
658
660
}
659
661
}
660
662
663
+ impl From < UnstableAudioDetailsContent > for RumaUnstableAudioDetailsContentBlock {
664
+ fn from ( details : UnstableAudioDetailsContent ) -> Self {
665
+ Self :: new (
666
+ details. duration ,
667
+ details. waveform . iter ( ) . map ( |x| UnstableAmplitude :: new ( x. to_owned ( ) ) ) . collect ( ) ,
668
+ )
669
+ }
670
+ }
671
+
661
672
#[ derive( Clone , uniffi:: Record ) ]
662
673
pub struct UnstableVoiceContent { }
663
674
@@ -667,6 +678,12 @@ impl From<RumaUnstableVoiceContentBlock> for UnstableVoiceContent {
667
678
}
668
679
}
669
680
681
+ impl From < UnstableVoiceContent > for RumaUnstableVoiceContentBlock {
682
+ fn from ( _details : UnstableVoiceContent ) -> Self {
683
+ Self :: new ( )
684
+ }
685
+ }
686
+
670
687
#[ derive( Clone , uniffi:: Record ) ]
671
688
pub struct VideoInfo {
672
689
pub duration : Option < Duration > ,
0 commit comments