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

Can update new user information fields

This commit is contained in:
2021-04-16 15:06:07 +02:00
parent b5d2410413
commit 2f931ff026
5 changed files with 13 additions and 1 deletions

View File

@ -23,6 +23,7 @@ use crate::data::user::{AccountImageVisibility, UserPageStatus};
use crate::helpers::{account_helper, custom_emojies_helper, user_helper};
use crate::helpers::virtual_directory_helper::VirtualDirType;
use crate::routes::RequestResult;
use crate::utils::string_utils::remove_html_nodes;
/// Get the general settings of the user
pub fn get_general(r: &mut HttpRequestHandler) -> RequestResult {
@ -52,10 +53,12 @@ pub fn set_general(r: &mut HttpRequestHandler) -> RequestResult {
block_comments: !r.post_bool("allowComments")?,
allow_posts_from_friends: r.post_bool("allowPostsFromFriends")?,
friends_list_public: r.post_bool("publicFriendsList")?,
email_public: r.post_bool("email_public")?,
personal_website,
virtual_directory,
allow_mails: r.post_bool("allow_comunic_mails")?,
public_note: Some(r.post_content("publicNote", 0, false)?),
location: r.post_string_optional("location").map(|s| remove_html_nodes(&s)),
};
account_helper::set_general(&new_settings)?;