mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-09-19 11:28:46 +00:00
Add new configuration fields
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::constants::{conservation_policy, MIN_SUPPORTED_MOBILE_VERSION, password_policy};
|
||||
use crate::constants::accounts_info_policy::{MAX_FIRST_NAME_LENGTH, MAX_LAST_NAME_LENGTH, MIN_FIRST_NAME_LENGTH, MIN_LAST_NAME_LENGTH};
|
||||
use crate::constants::conversations::{ALLOWED_CONVERSATION_FILES_TYPES, CONVERSATION_FILES_MAX_SIZE, CONVERSATION_WRITING_EVENT_INTERVAL, CONVERSATION_WRITING_EVENT_LIFETIME, MAX_CONV_IMAGE_MESSAGE_WIDTH, MAX_CONV_LOGO_HEIGHT, MAX_CONV_LOGO_WIDTH, MAX_CONV_MESSAGE_THUMBNAIL_HEIGHT, MAX_CONV_MESSAGE_THUMBNAIL_WIDTH, MAX_CONVERSATION_MESSAGE_LENGTH, MAX_CONVERSATION_NAME_LENGTH, MIN_CONVERSATION_MESSAGE_LENGTH};
|
||||
use crate::data::api_client::APIClient;
|
||||
use crate::data::config::conf;
|
||||
@@ -53,6 +54,14 @@ struct ConversationsPolicy {
|
||||
max_logo_height: u32,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct AccountInformationPolicy {
|
||||
min_first_name_length: u8,
|
||||
max_first_name_length: u8,
|
||||
min_last_name_length: u8,
|
||||
max_last_name_length: u8,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct ServerConfig {
|
||||
min_supported_mobile_version: &'static str,
|
||||
@@ -65,6 +74,7 @@ pub struct ServerConfig {
|
||||
password_policy: PasswordPolicy,
|
||||
data_conservation_policy: DataConservationPolicy,
|
||||
conversations_policy: ConversationsPolicy,
|
||||
account_info_policy: AccountInformationPolicy,
|
||||
}
|
||||
|
||||
impl ServerConfig {
|
||||
@@ -116,6 +126,13 @@ impl ServerConfig {
|
||||
max_logo_width: MAX_CONV_LOGO_WIDTH,
|
||||
max_logo_height: MAX_CONV_LOGO_HEIGHT,
|
||||
},
|
||||
|
||||
account_info_policy: AccountInformationPolicy {
|
||||
min_first_name_length: MIN_FIRST_NAME_LENGTH,
|
||||
max_first_name_length: MAX_FIRST_NAME_LENGTH,
|
||||
min_last_name_length: MIN_LAST_NAME_LENGTH,
|
||||
max_last_name_length: MAX_LAST_NAME_LENGTH,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user