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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user