diff --git a/src/api_data/admin/admin_search_user_result_api.rs b/src/api_data/admin/admin_search_user_result_api.rs index 3c749b7..beddfc3 100644 --- a/src/api_data/admin/admin_search_user_result_api.rs +++ b/src/api_data/admin/admin_search_user_result_api.rs @@ -10,7 +10,7 @@ pub struct AdminSearchUserResult { first_name: String, last_name: String, email: String, - account_image: String + account_image: Option } impl AdminSearchUserResult { diff --git a/src/api_data/admin/admin_user_info_api.rs b/src/api_data/admin/admin_user_info_api.rs index a024bfa..c91e127 100644 --- a/src/api_data/admin/admin_user_info_api.rs +++ b/src/api_data/admin/admin_user_info_api.rs @@ -16,7 +16,7 @@ pub struct AdminUserInfoAPI { last_activity: u64, page_visibility: &'static str, directory: Option, - account_image: String, + account_image: Option, account_image_visibility: String, friend_list_public: bool, is_email_public: bool, diff --git a/src/data/user.rs b/src/data/user.rs index 84ed8ca..c65530d 100644 --- a/src/data/user.rs +++ b/src/data/user.rs @@ -182,11 +182,11 @@ impl User { /// 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 { + pub fn account_image_url_for_admin(&self) -> Option { 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), + (_, None) => None, + (AccountImageVisibility::FRIENDS, _) => Some(User::error_account_image_url()), + (_, Some(path)) => Some(user_data_url(path)), } }