mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-07-15 19:58:05 +00:00
Can get data conservation policy
This commit is contained in:
29
src/api_data/data_conservation_settings_api.rs
Normal file
29
src/api_data/data_conservation_settings_api.rs
Normal file
@ -0,0 +1,29 @@
|
||||
//! # Data conservation settings API object
|
||||
//!
|
||||
//! @author Pierre Hubert
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::data::user::User;
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct DataConservationSettingsAPI {
|
||||
inactive_account_lifetime: Option<u64>,
|
||||
notification_lifetime: Option<u64>,
|
||||
comments_lifetime: Option<u64>,
|
||||
posts_lifetime: Option<u64>,
|
||||
conversation_messages_lifetime: Option<u64>,
|
||||
likes_lifetime: Option<u64>,
|
||||
}
|
||||
|
||||
impl DataConservationSettingsAPI {
|
||||
pub fn new(user: &User) -> Self {
|
||||
Self {
|
||||
inactive_account_lifetime: user.delete_account_after.clone(),
|
||||
notification_lifetime: user.delete_notifications_after,
|
||||
comments_lifetime: user.delete_comments_after,
|
||||
posts_lifetime: user.delete_posts_after,
|
||||
conversation_messages_lifetime: user.delete_conversation_messages_after,
|
||||
likes_lifetime: user.delete_likes_after,
|
||||
}
|
||||
}
|
||||
}
|
@ -55,6 +55,7 @@ pub mod general_settings_api;
|
||||
pub mod language_settings_api;
|
||||
pub mod security_settings_api;
|
||||
pub mod account_image_settings_api;
|
||||
pub mod data_conservation_settings_api;
|
||||
pub mod res_create_custom_emoji;
|
||||
pub mod res_get_ws_token;
|
||||
pub mod user_calls_config;
|
||||
|
Reference in New Issue
Block a user