Fixed warnings and migrated to TTP.
This commit is contained in:
parent
b4e8e42267
commit
7a331d4450
20 changed files with 107 additions and 55 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use epsilon_core::{CommunicationType, CommunicationValue, DataTypes, DataValue};
|
||||
use ttp_core::{CommunicationType, CommunicationValue, DataTypes, DataValue};
|
||||
|
||||
use std::{env, sync::Arc, time::Duration};
|
||||
use tokio::sync::RwLock;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use uuid::Uuid;
|
|||
use crate::calls::{call_group::CallGroup, caller::Caller};
|
||||
|
||||
pub static CALL_GROUPS: Lazy<DashMap<Uuid, Arc<CallGroup>>> = Lazy::new(|| DashMap::new());
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub async fn get_call_invites(user_id: u64) -> Vec<Arc<Caller>> {
|
||||
let mut callers = Vec::new();
|
||||
for (_, cg) in CALL_GROUPS.clone().into_iter() {
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ pub fn create_token(user_id: u64, call_id: Uuid, has_admin: bool) -> Result<Stri
|
|||
Err(())
|
||||
}
|
||||
}
|
||||
#[allow(dead_code)]
|
||||
pub async fn get_room(call_id: Uuid) -> Result<(RoomClient, Room), ()> {
|
||||
if let Ok((hostname, api_key, api_secret)) = get_livekit() {
|
||||
let room_service = RoomClient::with_api_key(&hostname, &api_key, &api_secret);
|
||||
|
|
@ -82,6 +83,7 @@ pub async fn remove_participant(call_id: Uuid, user_id: u64) -> Result<(), ()> {
|
|||
return Err(());
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub async fn get_room_metadata(call_id: Uuid) -> Result<String, ()> {
|
||||
if let Ok((_, room)) = get_room(call_id).await {
|
||||
Ok(room.metadata)
|
||||
|
|
|
|||
|
|
@ -21,12 +21,14 @@ impl Caller {
|
|||
timeout: RwLock::new(0),
|
||||
}
|
||||
}
|
||||
#[allow(dead_code)]
|
||||
pub fn set_admin(&mut self, has_admin: bool) {
|
||||
self.has_admin = has_admin;
|
||||
}
|
||||
pub fn has_admin(&self) -> bool {
|
||||
self.has_admin
|
||||
}
|
||||
#[allow(dead_code)]
|
||||
pub async fn is_timeouted(&self) -> bool {
|
||||
*self.timeout.read().await
|
||||
> SystemTime::now()
|
||||
|
|
|
|||
Loading…
Reference in a new issue