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

Can update data conservation policy

This commit is contained in:
2021-02-15 19:29:43 +01:00
parent 3e73a0376b
commit aa8916b8f2
7 changed files with 93 additions and 1 deletions

View File

@ -356,6 +356,13 @@ pub trait BaseRequestHandler {
Ok(self.post_string(name)?.parse::<u64>()?)
}
fn post_positive_u64_opt(&mut self, name: &str) -> Res<Option<u64>> {
match self.post_u64(name)? {
0 => Ok(None),
val => Ok(Some(val))
}
}
/// Get a boolean included in a POST request
fn post_bool(&mut self, name: &str) -> ResultBoxError<bool> {
Ok(self.post_string(name)?.eq("true"))

View File

@ -34,6 +34,7 @@ pub mod survey_response;
pub mod general_settings;
pub mod lang_settings;
pub mod security_settings;
pub mod new_data_conservation_policy;
pub mod new_custom_emoji;
pub mod user_ws_message;
pub mod user_ws_connection;

View File

@ -0,0 +1,15 @@
//! # New data conservation policy settings
//!
//! @author Pierre Hubert
use crate::data::user::UserID;
pub struct NewDataConservationPolicy {
pub user_id: UserID,
pub delete_account_after: Option<u64>,
pub delete_notifications_after: Option<u64>,
pub delete_comments_after: Option<u64>,
pub delete_posts_after: Option<u64>,
pub delete_conversation_messages_after: Option<u64>,
pub delete_likes_after: Option<u64>,
}