1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-20 16:35:17 +00:00

Ready to implement account image visibility

This commit is contained in:
2020-05-26 13:53:24 +02:00
parent d355f33cb0
commit cca7f02f8e
6 changed files with 47 additions and 7 deletions

View File

@ -256,6 +256,11 @@ impl HttpRequestHandler {
}
}
/// Get a user ID, if available
pub fn user_id_opt(&self) -> Option<UserID> {
self.curr_user_id
}
/// Get an email included in the request
pub fn post_email(&mut self, name: &str) -> ResultBoxError<String> {
let mail = self.post_string(name)?;

View File

@ -11,6 +11,14 @@ pub enum UserPageStatus {
PRIVATE
}
#[derive(Debug, PartialEq)]
#[allow(non_camel_case_types)]
pub enum AccountImageVisibility {
FRIENDS,
COMUNIC_USERS,
EVERYONE
}
#[derive(Debug)]
pub struct User {
pub id: UserID,
@ -20,4 +28,6 @@ pub struct User {
pub last_name: String,
pub status: UserPageStatus,
pub virtual_directory: Option<String>,
pub account_image_path: Option<String>,
pub account_image_visibility: AccountImageVisibility,
}