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

Enforce messages text len policy

This commit is contained in:
2021-03-05 12:30:40 +01:00
parent 7ce29bca3e
commit 590aba0848
3 changed files with 30 additions and 6 deletions

View File

@ -3,7 +3,7 @@
//! @author Pierre Hubert
use serde::Serialize;
use crate::constants::{conservation_policy, MIN_SUPPORTED_MOBILE_VERSION, password_policy};
use crate::constants::{conservation_policy, MIN_SUPPORTED_MOBILE_VERSION, password_policy, MIN_CONVERSATION_MESSAGE_LENGTH, MAX_CONVERSATION_MESSAGE_LENGTH};
use crate::data::config::conf;
#[derive(Serialize)]
@ -37,6 +37,8 @@ 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,
}
impl ServerConfig {
@ -47,6 +49,10 @@ impl ServerConfig {
privacy_policy_url: &conf().privacy_policy_url,
play_store_url: &conf().play_store_url,
android_direct_download_url: conf().android_direct_download_url.clone(),
min_conversation_message_len: MIN_CONVERSATION_MESSAGE_LENGTH,
max_conversation_message_len: MAX_CONVERSATION_MESSAGE_LENGTH,
password_policy: PasswordPolicy {
allow_email_in_password: password_policy::ALLOW_EMAIL_IN_PASSWORD,
allow_name_in_password: password_policy::ALLOW_NAME_IN_PASSWORD,