api: add call_info() JSON-RPC API

This commit is contained in:
link2xt
2025-09-19 14:01:06 +00:00
committed by l
parent 3680467e14
commit 738dc5ce19
6 changed files with 82 additions and 7 deletions

View File

@@ -48,6 +48,7 @@ pub mod types;
use num_traits::FromPrimitive;
use types::account::Account;
use types::calls::JsonrpcCallInfo;
use types::chat::FullChat;
use types::contact::{ContactObject, VcardContact};
use types::events::Event;
@@ -2117,6 +2118,13 @@ impl CommandApi {
Ok(())
}
/// Returns information about the call.
async fn call_info(&self, account_id: u32, msg_id: u32) -> Result<JsonrpcCallInfo> {
let ctx = self.get_context(account_id).await?;
let call_info = JsonrpcCallInfo::from_msg_id(&ctx, MsgId::new(msg_id)).await?;
Ok(call_info)
}
/// Returns JSON with ICE servers, to be used for WebRTC video calls.
async fn ice_servers(&self, account_id: u32) -> Result<String> {
let ctx = self.get_context(account_id).await?;