mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-02-23 01:01:16 +00:00
27 lines
574 B
Rust
27 lines
574 B
Rust
|
//! # 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)?,
|
||
|
})
|
||
|
}
|
||
|
}
|