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 @@ -1765,6 +1765,12 @@ impl MimeFactory {
17651765 mail_builder:: headers:: raw:: Raw :: new ( b_encode ( answer) ) . into ( ) ,
17661766 ) ) ;
17671767 }
1768+ if let Some ( has_video) = msg. param . get ( Param :: CallHasVideoInitially ) {
1769+ headers. push ( (
1770+ "Chat-Webrtc-Has-Video-Initially" ,
1771+ mail_builder:: headers:: raw:: Raw :: new ( b_encode ( has_video) ) . into ( ) ,
1772+ ) )
1773+ }
17681774
17691775 if msg. viewtype == Viewtype :: Voice
17701776 || msg. viewtype == Viewtype :: Audio
Original file line number Diff line number Diff line change @@ -738,6 +738,9 @@ impl MimeMessage {
738738 let accepted = self
739739 . get_header ( HeaderDef :: ChatWebrtcAccepted )
740740 . map ( |s| s. to_string ( ) ) ;
741+ let has_video = self
742+ . get_header ( HeaderDef :: ChatWebrtcHasVideoInitially )
743+ . map ( |s| s. to_string ( ) ) ;
741744 if let Some ( part) = self . parts . first_mut ( ) {
742745 if let Some ( room) = room {
743746 if content == "call" {
@@ -747,6 +750,9 @@ impl MimeMessage {
747750 } else if let Some ( accepted) = accepted {
748751 part. param . set ( Param :: WebrtcAccepted , accepted) ;
749752 }
753+ if let Some ( has_video) = has_video {
754+ part. param . set ( Param :: CallHasVideoInitially , has_video) ;
755+ }
750756 }
751757 }
752758
You can’t perform that action at this time.
0 commit comments