1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-07-03 22:45:01 +00:00

Account image URL is null if unset

This commit is contained in:
2021-07-12 18:43:17 +02:00
parent e5b64746b4
commit c14a0da518
3 changed files with 6 additions and 6 deletions

View File

@ -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<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),
(_, None) => None,
(AccountImageVisibility::FRIENDS, _) => Some(User::error_account_image_url()),
(_, Some(path)) => Some(user_data_url(path)),
}
}