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

Get path to user data files

This commit is contained in:
2020-05-26 18:02:14 +02:00
parent 175266f397
commit 305e836d78
4 changed files with 37 additions and 2 deletions

View File

@ -1,3 +1,5 @@
use crate::utils::user_data_utils::user_data_url;
///! User information
///!
///! @author Pierre Hubert
@ -30,4 +32,18 @@ pub struct User {
pub virtual_directory: Option<String>,
pub account_image_path: Option<String>,
pub account_image_visibility: AccountImageVisibility,
}
impl User {
/// Get the URL pointing to the default account image
pub fn default_account_image_url() -> String {
user_data_url(crate::constants::DEFAULT_ACCOUNT_IMAGE)
}
/// Get the URL pointing to the error account image, when the user is not allowed to see user
/// account image
pub fn error_account_image_url() -> String {
user_data_url(crate::constants::ERROR_ACCOUNT_IMAGE)
}
}