1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-07-10 17:42:48 +00:00

Add banner

This commit is contained in:
2021-12-29 19:10:47 +01:00
parent 80d8961160
commit bbe8252f9d
3 changed files with 79 additions and 1 deletions

View File

@ -7,7 +7,7 @@ use crate::constants::{conservation_policy, MIN_SUPPORTED_MOBILE_VERSION, passwo
use crate::constants::accounts_info_policy::{MAX_FIRST_NAME_LENGTH, MAX_LAST_NAME_LENGTH, MAX_LOCATION_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;
use crate::data::config::{Banner, conf};
#[derive(Serialize)]
struct NotificationsConfig {
@ -72,6 +72,7 @@ pub struct ServerConfig {
play_store_url: &'static str,
android_direct_download_url: String,
banner: Option<&'static Banner>,
push_notifications: NotificationsConfig,
password_policy: PasswordPolicy,
data_conservation_policy: DataConservationPolicy,
@ -89,6 +90,11 @@ impl ServerConfig {
play_store_url: &conf().play_store_url,
android_direct_download_url: conf().android_direct_download_url.clone(),
banner: match conf().banner.as_ref().map(|b| b.is_visible()).unwrap_or(false) {
true => conf().banner.as_ref(),
false => None,
},
push_notifications: NotificationsConfig {
has_firebase: c.is_firebase_available(),
has_independent: conf().is_independent_push_notifications_service_enabled(),