removing fluff idea work

This commit is contained in:
shockrah 2019-12-02 13:47:36 -08:00
parent a0ad1f9b47
commit 6e5088354c

View File

@ -1,58 +0,0 @@
/* Here we maintain all the different structures that we use to
* interface with our database at any given time
*/
use diesel::prelude::SqliteConnection;
enum UserType {
Native,
Remote,
Invalid,
}
#[table_name="users"]
#[derive(Serialize, Queryable, Insertable, Debug, Clone)]
struct User {
userid: String,
/* Sometimes this isn't a password persey
* Basically: native users and remote users will share this here but
* remote users are given a passkey which they don't control.
*/
passkey: String,
native: bool,
display: String,
}
#[derive(FromForm)]
struct UserRegister{
userid: String,
display: String,
passkey: String, // basically just a hash for now
}
struct Ticket {
hashValue: String // probably just some huge text hash
}
impl User {
/* only ever add a user to our database if they have a ticket whose id matches with
* a currently valid id
* This means that instances can be set to invite only if owners wish
*/
pub fn insert(user: UserLogin, entry: Ticket, conn: &SqliteConnection) -> bool {
}
pub fn remove(userid: String) -> Result<User> {
}
pub fn get_user(userid: String) -> Result<User> {
}
pub fn update_display(userid: String) -> bool {
}
pub fn update_passkey(userid: String, newpass_hash: String) -> bool {
}
pub fn update_native(userid: String, newdisplay: String) -> bool {
}
}