Skip to content

Commit c3aba61

Browse files
committed
Actually send the has_video_initially to recipient
1 parent fc97271 commit c3aba61

4 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/calls/calls_tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

src/headerdef.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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,

src/mimefactory.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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

src/mimeparser.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)