mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-21 00:45:18 +00:00
Can get general settings
This commit is contained in:
@ -76,6 +76,7 @@ pub struct User {
|
||||
pub block_comments_on_his_page: bool,
|
||||
pub allow_posts_from_friends: bool,
|
||||
pub account_creation_time: u64,
|
||||
pub allow_mails: bool,
|
||||
pub security_question_1: Option<String>,
|
||||
pub security_answer_1: Option<String>,
|
||||
pub security_question_2: Option<String>,
|
||||
@ -83,6 +84,16 @@ pub struct User {
|
||||
}
|
||||
|
||||
impl User {
|
||||
/// Check if user's page is public
|
||||
pub fn is_page_public(&self) -> bool {
|
||||
!matches!(self.status, UserPageStatus::PRIVATE)
|
||||
}
|
||||
|
||||
/// Check if user's page is open
|
||||
pub fn is_page_open(&self) -> bool {
|
||||
matches!(self.status, UserPageStatus::OPEN)
|
||||
}
|
||||
|
||||
/// Get the URL pointing to the default account image
|
||||
pub fn default_account_image_url() -> String {
|
||||
user_data_url(crate::constants::DEFAULT_ACCOUNT_IMAGE)
|
||||
|
Reference in New Issue
Block a user