1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-21 08:55:16 +00:00

Can update account image visibility

This commit is contained in:
2021-01-19 18:48:56 +01:00
parent 33eab5919b
commit 1fd3a8e6d9
5 changed files with 38 additions and 5 deletions

View File

@ -67,6 +67,22 @@ impl AccountImageVisibility {
AccountImageVisibility::EVERYONE => "open".to_string(),
}
}
pub fn from_api(s: &str) -> Self {
match s {
"friends" => AccountImageVisibility::FRIENDS,
"public" => AccountImageVisibility::COMUNIC_USERS,
"open" | _ => AccountImageVisibility::EVERYONE,
}
}
pub fn to_db(&self) -> String {
match self {
AccountImageVisibility::FRIENDS => "friends".to_string(),
AccountImageVisibility::COMUNIC_USERS => "comunic_users".to_string(),
AccountImageVisibility::EVERYONE => "everyone".to_string(),
}
}
}
#[derive(Debug)]