File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ async fn setup_call() -> Result<CallSetup> {
6868 assert ! ( !info. is_incoming( ) ) ;
6969 assert ! ( !info. is_accepted( ) ) ;
7070 assert_eq ! ( info. place_call_info, PLACE_INFO ) ;
71+ assert_eq ! ( info. has_video_initially( ) , true ) ;
7172 assert_text ( t, m. id , "Outgoing call" ) . await ?;
7273 assert_eq ! ( call_state( t, m. id) . await ?, CallState :: Alerting ) ;
7374 }
@@ -89,6 +90,7 @@ async fn setup_call() -> Result<CallSetup> {
8990 assert ! ( info. is_incoming( ) ) ;
9091 assert ! ( !info. is_accepted( ) ) ;
9192 assert_eq ! ( info. place_call_info, PLACE_INFO ) ;
93+ assert_eq ! ( info. has_video_initially( ) , true ) ;
9294 assert_text ( t, m. id , "Incoming call" ) . await ?;
9395 assert_eq ! ( call_state( t, m. id) . await ?, CallState :: Alerting ) ;
9496 }
Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ pub enum HeaderDef {
9191 ChatDispositionNotificationTo ,
9292 ChatWebrtcRoom ,
9393 ChatWebrtcAccepted ,
94+ ChatWebrtcHasVideoInitially ,
9495
9596 /// This message deletes the messages listed in the value by rfc724_mid.
9697 ChatDelete ,
Original file line number Diff line number Diff line change @@ -1840,6 +1840,12 @@ impl MimeFactory {
18401840 mail_builder:: headers:: raw:: Raw :: new ( b_encode ( answer) ) . into ( ) ,
18411841 ) ) ;
18421842 }
1843+ if let Some ( has_video) = msg. param . get ( Param :: CallHasVideoInitially ) {
1844+ headers. push ( (
1845+ "Chat-Webrtc-Has-Video-Initially" ,
1846+ mail_builder:: headers:: raw:: Raw :: new ( b_encode ( has_video) ) . into ( ) ,
1847+ ) )
1848+ }
18431849
18441850 if msg. viewtype == Viewtype :: Voice
18451851 || msg. viewtype == Viewtype :: Audio
Original file line number Diff line number Diff line change @@ -801,6 +801,9 @@ impl MimeMessage {
801801 let accepted = self
802802 . get_header ( HeaderDef :: ChatWebrtcAccepted )
803803 . map ( |s| s. to_string ( ) ) ;
804+ let has_video = self
805+ . get_header ( HeaderDef :: ChatWebrtcHasVideoInitially )
806+ . map ( |s| s. to_string ( ) ) ;
804807 if let Some ( part) = self . parts . first_mut ( ) {
805808 if let Some ( room) = room {
806809 if content == "call" {
@@ -810,6 +813,9 @@ impl MimeMessage {
810813 } else if let Some ( accepted) = accepted {
811814 part. param . set ( Param :: WebrtcAccepted , accepted) ;
812815 }
816+ if let Some ( has_video) = has_video {
817+ part. param . set ( Param :: CallHasVideoInitially , has_video) ;
818+ }
813819 }
814820 }
815821
You can’t perform that action at this time.
0 commit comments