Essential data now passable from server to client regarding channels

This commit is contained in:
shockrah 2020-03-31 17:15:01 -07:00
parent 972d79d44b
commit a217c64666
3 changed files with 16 additions and 1 deletions

View File

@ -24,6 +24,7 @@ mod payload;
mod rand_utils; mod rand_utils;
mod users; mod users;
mod channels; mod channels;
mod err;
use invites::*; use invites::*;
use channels::*; use channels::*;
use users::*; use users::*;
@ -38,7 +39,7 @@ pub fn rocket() -> rocket::Rocket {
generate_invite, use_invite generate_invite, use_invite
]) ])
.mount("/channels", routes![ .mount("/channels", routes![
get_voice_channels get_voice_channels, insert_new_channel, get_text_chanels
]) ])
.mount("/users", routes![ .mount("/users", routes![
remove_user, get_user_list remove_user, get_user_list

View File

@ -35,3 +35,12 @@ pub struct Channel {
pub limit: i32, // <= 0 means there is no limit pub limit: i32, // <= 0 means there is no limit
pub type_: i32, // 1 for voice 2 for text pub type_: i32, // 1 for voice 2 for text
} }
#[derive(Insertable)]
#[table_name = "channels"]
pub struct InsertableChannel {
pub name: String,
pub permissions: i32,
pub limit: i32, // <= 0 means there is no limit
pub type_: i32, // 1 for voice 2 for text
}

View File

@ -22,6 +22,11 @@ pub struct OnlineUser {
status: i32, status: i32,
} }
#[derive(Serialize, Deserialize)]
pub struct ChannelIndexed {
pub name: String,
pub ctype: i32,
}
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct VoiceChannel { pub struct VoiceChannel {
pub id: i32, pub id: i32,