Skip to content

Commit e219ab5

Browse files
committed
Actually send the has_video_initially to recipient
1 parent 60f97fc commit e219ab5

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
@@ -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

src/mimeparser.rs

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

0 commit comments

Comments
 (0)