Connection With Omega

This commit is contained in:
Alex Emmet 2026-01-05 02:17:12 +01:00
commit 504e5ff015
20 changed files with 880 additions and 320 deletions

View file

@ -5,19 +5,25 @@ use crate::calls::call_util;
pub struct Caller {
pub user_id: i64,
pub call_id: Uuid,
pub inviters: Vec<i64>,
pub has_admin: bool,
}
impl Caller {
pub fn new(user_id: i64, call_id: Uuid, inviter_id: i64) -> Self {
pub fn new(user_id: i64, call_id: Uuid, has_admin: bool) -> Self {
Caller {
user_id,
call_id,
inviters: vec![inviter_id],
has_admin,
}
}
pub fn set_admin(&mut self, has_admin: bool) {
self.has_admin = has_admin;
}
pub fn has_admin(&self) -> bool {
self.has_admin
}
pub fn create_token(&self) -> String {
if let Ok(token) = call_util::create_token(self.user_id, self.call_id) {
if let Ok(token) = call_util::create_token(self.user_id, self.call_id, self.has_admin()) {
token
} else {
String::new()