new field for online status of users

new short structure describing online users
This commit is contained in:
shockrah 2020-03-17 21:34:32 -07:00
parent a3af490dc9
commit f343f6d252
4 changed files with 9 additions and 0 deletions

View File

@ -8,5 +8,6 @@ CREATE TABLE IF NOT EXISTS `users` (
`username` varchar(255) NOT NULL,
`key` varchar(255) NOT NULL,
`date` bigint UNSIGNED NOT NULL,
`status` int NOT NULL,
PRIMARY KEY( `userid` )
);

View File

@ -14,8 +14,14 @@ pub struct User {
pub username: String,
pub key: String,
pub date: u64,
pub status: i32,
}
pub const USER_OFFLINE: i32 = 1;
pub const USER_ONLINE: i32 = 2;
pub const USER_AWAY: i32 = 3;
pub const USER_DO_NOT_DISTRUB: i32 = 4;
// These are to be use specifically for discerning between channel types
pub const VOICE_CHANNEL: i32 = 1;
pub const TEXT_CHANNEL: i32 = 2;

View File

@ -15,6 +15,7 @@ pub struct NewUserResponse {
}
// This is basically anyone that's online at the moment
#[derive(Serialize, Debug)]
pub struct OnlineUser {
pub id: u64,
pub username: String,

View File

@ -23,6 +23,7 @@ table! {
username -> Varchar,
key -> Varchar,
date -> Unsigned<Bigint>,
status -> Integer,
}
}