mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
Actually send the has_video_initially to recipient
This commit is contained in:
@@ -68,6 +68,7 @@ async fn setup_call() -> Result<CallSetup> {
|
|||||||
assert!(!info.is_incoming());
|
assert!(!info.is_incoming());
|
||||||
assert!(!info.is_accepted());
|
assert!(!info.is_accepted());
|
||||||
assert_eq!(info.place_call_info, PLACE_INFO);
|
assert_eq!(info.place_call_info, PLACE_INFO);
|
||||||
|
assert_eq!(info.has_video_initially(), true);
|
||||||
assert_text(t, m.id, "Outgoing call").await?;
|
assert_text(t, m.id, "Outgoing call").await?;
|
||||||
assert_eq!(call_state(t, m.id).await?, CallState::Alerting);
|
assert_eq!(call_state(t, m.id).await?, CallState::Alerting);
|
||||||
}
|
}
|
||||||
@@ -89,6 +90,7 @@ async fn setup_call() -> Result<CallSetup> {
|
|||||||
assert!(info.is_incoming());
|
assert!(info.is_incoming());
|
||||||
assert!(!info.is_accepted());
|
assert!(!info.is_accepted());
|
||||||
assert_eq!(info.place_call_info, PLACE_INFO);
|
assert_eq!(info.place_call_info, PLACE_INFO);
|
||||||
|
assert_eq!(info.has_video_initially(), true);
|
||||||
assert_text(t, m.id, "Incoming call").await?;
|
assert_text(t, m.id, "Incoming call").await?;
|
||||||
assert_eq!(call_state(t, m.id).await?, CallState::Alerting);
|
assert_eq!(call_state(t, m.id).await?, CallState::Alerting);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ pub enum HeaderDef {
|
|||||||
ChatDispositionNotificationTo,
|
ChatDispositionNotificationTo,
|
||||||
ChatWebrtcRoom,
|
ChatWebrtcRoom,
|
||||||
ChatWebrtcAccepted,
|
ChatWebrtcAccepted,
|
||||||
|
ChatWebrtcHasVideoInitially,
|
||||||
|
|
||||||
/// This message deletes the messages listed in the value by rfc724_mid.
|
/// This message deletes the messages listed in the value by rfc724_mid.
|
||||||
ChatDelete,
|
ChatDelete,
|
||||||
|
|||||||
@@ -1765,6 +1765,12 @@ impl MimeFactory {
|
|||||||
mail_builder::headers::raw::Raw::new(b_encode(answer)).into(),
|
mail_builder::headers::raw::Raw::new(b_encode(answer)).into(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
if let Some(has_video) = msg.param.get(Param::CallHasVideoInitially) {
|
||||||
|
headers.push((
|
||||||
|
"Chat-Webrtc-Has-Video-Initially",
|
||||||
|
mail_builder::headers::raw::Raw::new(b_encode(has_video)).into(),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
if msg.viewtype == Viewtype::Voice
|
if msg.viewtype == Viewtype::Voice
|
||||||
|| msg.viewtype == Viewtype::Audio
|
|| msg.viewtype == Viewtype::Audio
|
||||||
|
|||||||
@@ -738,6 +738,9 @@ impl MimeMessage {
|
|||||||
let accepted = self
|
let accepted = self
|
||||||
.get_header(HeaderDef::ChatWebrtcAccepted)
|
.get_header(HeaderDef::ChatWebrtcAccepted)
|
||||||
.map(|s| s.to_string());
|
.map(|s| s.to_string());
|
||||||
|
let has_video = self
|
||||||
|
.get_header(HeaderDef::ChatWebrtcHasVideoInitially)
|
||||||
|
.map(|s| s.to_string());
|
||||||
if let Some(part) = self.parts.first_mut() {
|
if let Some(part) = self.parts.first_mut() {
|
||||||
if let Some(room) = room {
|
if let Some(room) = room {
|
||||||
if content == "call" {
|
if content == "call" {
|
||||||
@@ -747,6 +750,9 @@ impl MimeMessage {
|
|||||||
} else if let Some(accepted) = accepted {
|
} else if let Some(accepted) = accepted {
|
||||||
part.param.set(Param::WebrtcAccepted, accepted);
|
part.param.set(Param::WebrtcAccepted, accepted);
|
||||||
}
|
}
|
||||||
|
if let Some(has_video) = has_video {
|
||||||
|
part.param.set(Param::CallHasVideoInitially, has_video);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user