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:
@ -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)]
|
||||
|
Reference in New Issue
Block a user