has_video_initially

This commit is contained in:
Casper Zandbergen
2026-01-06 13:28:31 +01:00
parent 9d7db20225
commit ee7aa989bf
9 changed files with 30 additions and 43 deletions

View File

@@ -2141,10 +2141,11 @@ impl CommandApi {
account_id: u32,
chat_id: u32,
place_call_info: String,
has_video_initially: bool,
) -> Result<u32> {
let ctx = self.get_context(account_id).await?;
let msg_id = ctx
.place_outgoing_call(ChatId::new(chat_id), place_call_info)
.place_outgoing_call(ChatId::new(chat_id), place_call_info, has_video_initially)
.await?;
Ok(msg_id.to_u32())
}

View File

@@ -1,6 +1,6 @@
use anyhow::{Context as _, Result};
use deltachat::calls::{call_state, sdp_has_video, CallState};
use deltachat::calls::{call_state, CallState};
use deltachat::context::Context;
use deltachat::message::MsgId;
use serde::Serialize;
@@ -15,8 +15,8 @@ pub struct JsonrpcCallInfo {
/// even if incoming call event was missed.
pub sdp_offer: String,
/// True if SDP offer has a video.
pub has_video: bool,
/// True if the call is started as a video call.
pub has_video_initially: bool,
/// Call state.
///
@@ -30,12 +30,12 @@ impl JsonrpcCallInfo {
format!("Attempting to get call state of non-call message {msg_id}")
})?;
let sdp_offer = call_info.place_call_info.clone();
let has_video = sdp_has_video(&sdp_offer).unwrap_or_default();
let has_video_initially = call_info.has_video_initially();
let state = JsonrpcCallState::from_msg_id(context, msg_id).await?;
Ok(JsonrpcCallInfo {
sdp_offer,
has_video,
has_video_initially,
state,
})
}