1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-22 21:39:21 +00:00

Added new values

This commit is contained in:
Pierre HUBERT 2021-03-08 17:54:45 +01:00
parent 21669c5a02
commit 1782647f8c
2 changed files with 13 additions and 2 deletions

View File

@ -3,7 +3,7 @@
//! @author Pierre Hubert
use serde::Serialize;
use crate::constants::{ALLOWED_CONVERSATION_FILES_TYPES, conservation_policy, CONVERSATION_FILES_MAX_SIZE, MAX_CONVERSATION_MESSAGE_LENGTH, MIN_CONVERSATION_MESSAGE_LENGTH, MIN_SUPPORTED_MOBILE_VERSION, password_policy};
use crate::constants::{ALLOWED_CONVERSATION_FILES_TYPES, conservation_policy, CONVERSATION_FILES_MAX_SIZE, CONVERSATION_WRITING_EVENT_INTERVAL, CONVERSATION_WRITING_EVENT_LIFETIME, MAX_CONVERSATION_MESSAGE_LENGTH, MIN_CONVERSATION_MESSAGE_LENGTH, MIN_SUPPORTED_MOBILE_VERSION, password_policy};
use crate::data::config::conf;
#[derive(Serialize)]
@ -37,10 +37,13 @@ pub struct ServerConfig {
android_direct_download_url: String,
password_policy: PasswordPolicy,
data_conservation_policy: DataConservationPolicy,
min_conversation_message_len: usize,
max_conversation_message_len: usize,
allowed_conversation_files_type: [&'static str; 17],
conversation_files_max_size: usize,
conversation_writing_event_interval: u64,
conversation_writing_event_lifetime: u64,
}
impl ServerConfig {
@ -56,6 +59,8 @@ impl ServerConfig {
max_conversation_message_len: MAX_CONVERSATION_MESSAGE_LENGTH,
allowed_conversation_files_type: ALLOWED_CONVERSATION_FILES_TYPES,
conversation_files_max_size: CONVERSATION_FILES_MAX_SIZE,
conversation_writing_event_interval: CONVERSATION_WRITING_EVENT_INTERVAL,
conversation_writing_event_lifetime: CONVERSATION_WRITING_EVENT_LIFETIME,
password_policy: PasswordPolicy {
allow_email_in_password: password_policy::ALLOW_EMAIL_IN_PASSWORD,

View File

@ -192,3 +192,9 @@ pub const ALLOWED_CONVERSATION_FILES_TYPES: [&str; 17] = [
/// File maximum size in conversations (10 Mb)
pub const CONVERSATION_FILES_MAX_SIZE: usize = 10 * 1024 * 1024;
/// Minimum interval before notifying again that someone is writing
pub const CONVERSATION_WRITING_EVENT_INTERVAL: u64 = 1;
/// Lifetime of conversation writing event
pub const CONVERSATION_WRITING_EVENT_LIFETIME: u64 = 3;