1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-21 00:45:18 +00:00

Relay messages from RTC proxy to user

This commit is contained in:
2021-02-11 19:07:30 +01:00
parent 4c8d4345a2
commit 50b094acfb
6 changed files with 132 additions and 6 deletions

View File

@ -60,4 +60,5 @@ pub mod res_get_ws_token;
pub mod user_calls_config;
pub mod joined_call_message;
pub mod call_member_info;
pub mod left_call_message;
pub mod left_call_message;
pub mod new_call_signal;

View File

@ -0,0 +1,27 @@
//! # New call signal
//!
//! @author Pierre Hubert
use serde::Serialize;
use crate::data::conversation::ConvID;
use crate::data::error::Res;
use crate::data::user::UserID;
#[derive(Serialize)]
#[allow(non_snake_case)]
pub struct NewCallSignalAPI {
callID: u64,
peerID: u64,
data: serde_json::Value,
}
impl NewCallSignalAPI {
pub fn new(call_id: &ConvID, peer_id: &UserID, data: &str) -> Res<Self> {
Ok(Self {
callID: call_id.clone(),
peerID: peer_id.id(),
data: serde_json::from_str(data)?,
})
}
}