mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-07-03 22:45:01 +00:00
Administrators can search for users
This commit is contained in:
@ -170,6 +170,16 @@ impl User {
|
||||
user_data_url(crate::constants::ERROR_ACCOUNT_IMAGE)
|
||||
}
|
||||
|
||||
/// Get the URL pointing to a user account image for an administrator. An administrator can
|
||||
/// only access to the user account image if it is visible to all Comunic users
|
||||
pub fn account_image_url_for_admin(&self) -> String {
|
||||
match (&self.account_image_visibility, &self.account_image_path) {
|
||||
(AccountImageVisibility::FRIENDS, _) => User::error_account_image_url(),
|
||||
(_, None) => User::default_account_image_url(),
|
||||
(_, Some(path)) => user_data_url(path),
|
||||
}
|
||||
}
|
||||
|
||||
/// Check if this user has an account image or not
|
||||
pub fn has_account_image(&self) -> bool {
|
||||
self.account_image_path.is_some()
|
||||
|
Reference in New Issue
Block a user