1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-20 16:35:17 +00:00

Can get the list of members of a call

This commit is contained in:
2021-02-10 17:32:14 +01:00
parent 2e5cdca850
commit 3c696bde5f
6 changed files with 67 additions and 2 deletions

View File

@ -7,7 +7,8 @@ use serde::Serialize;
use crate::api_data::http_error::HttpError;
use crate::controllers::routes::RequestResult;
use crate::data::base_request_handler::{BaseRequestHandler, RequestValue};
use crate::data::error::ResultBoxError;
use crate::data::conversation::ConvID;
use crate::data::error::{Res, ResultBoxError};
use crate::data::user::UserID;
use crate::data::user_ws_connection::UserWsConnection;
@ -56,6 +57,17 @@ impl UserWsRequestHandler {
Ok(())
}
/// Get the ID of a call included in a WebSocket request
pub fn post_call_id(&mut self, name: &str) -> Res<ConvID> {
let conv_id = self.post_u64(name)?;
if !self.connection.is_having_call_with_conversation(&conv_id) {
self.forbidden("You do not belong to this call!".to_string())?;
}
Ok(conv_id)
}
}
impl BaseRequestHandler for UserWsRequestHandler {