diff --git a/src/api_data/server_config.rs b/src/api_data/server_config.rs index 9039fed..799974f 100644 --- a/src/api_data/server_config.rs +++ b/src/api_data/server_config.rs @@ -5,8 +5,8 @@ use serde::Serialize; use crate::constants::{conservation_policy, MIN_SUPPORTED_MOBILE_VERSION, password_policy}; 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::config::conf; use crate::data::api_client::APIClient; +use crate::data::config::conf; #[derive(Serialize)] struct NotificationsConfig { @@ -61,7 +61,7 @@ pub struct ServerConfig { play_store_url: &'static str, android_direct_download_url: String, - notifications: NotificationsConfig, + push_notifications: NotificationsConfig, password_policy: PasswordPolicy, data_conservation_policy: DataConservationPolicy, conversations_policy: ConversationsPolicy, @@ -76,7 +76,7 @@ impl ServerConfig { play_store_url: &conf().play_store_url, android_direct_download_url: conf().android_direct_download_url.clone(), - notifications: NotificationsConfig { + push_notifications: NotificationsConfig { has_firebase: c.is_firebase_available(), has_independent: conf().is_independent_push_notifications_service_enabled(), }, diff --git a/src/controllers/push_notifications_controller.rs b/src/controllers/push_notifications_controller.rs index 453eb51..9c0a60b 100644 --- a/src/controllers/push_notifications_controller.rs +++ b/src/controllers/push_notifications_controller.rs @@ -7,7 +7,7 @@ use crate::data::base_request_handler::BaseRequestHandler; use crate::data::config::conf; use crate::data::http_request_handler::HttpRequestHandler; use crate::data::user_token::PushNotificationToken; -use crate::helpers::{account_helper, independent_push_notification_service_helper}; +use crate::helpers::{account_helper, independent_push_notifications_service_helper}; use crate::routes::RequestResult; /// Get current push notifications status for a connection @@ -37,7 +37,7 @@ pub fn configure(r: &mut HttpRequestHandler) -> RequestResult { return r.bad_request("Independent service is unavailable!".to_string()); } - let token = independent_push_notification_service_helper::create_token()?; + let token = independent_push_notifications_service_helper::create_token()?; PushNotificationToken::INDEPENDENT(token) } diff --git a/src/helpers/independent_push_notification_service_helper.rs b/src/helpers/independent_push_notifications_service_helper.rs similarity index 100% rename from src/helpers/independent_push_notification_service_helper.rs rename to src/helpers/independent_push_notifications_service_helper.rs diff --git a/src/helpers/mod.rs b/src/helpers/mod.rs index 4932c0d..0728c06 100644 --- a/src/helpers/mod.rs +++ b/src/helpers/mod.rs @@ -19,4 +19,4 @@ pub mod requests_limit_helper; pub mod events_helper; pub mod calls_helper; pub mod push_notifications_helper; -pub mod independent_push_notification_service_helper; \ No newline at end of file +pub mod independent_push_notifications_service_helper; \ No newline at end of file diff --git a/src/helpers/push_notifications_helper.rs b/src/helpers/push_notifications_helper.rs index 8f35b0a..c9e4e57 100644 --- a/src/helpers/push_notifications_helper.rs +++ b/src/helpers/push_notifications_helper.rs @@ -4,14 +4,14 @@ use crate::data::user_token::{UserAccessToken, PushNotificationToken}; use crate::data::error::Res; -use crate::helpers::independent_push_notification_service_helper; +use crate::helpers::independent_push_notifications_service_helper; /// Un-register for previous push notifications service pub fn un_register_from_previous_service(client: &UserAccessToken) -> Res { // This method must not fail in case of error if let PushNotificationToken::INDEPENDENT(old_token) = &client.push_notifications_token { - if let Err(e) = independent_push_notification_service_helper::remove_token(old_token) { + if let Err(e) = independent_push_notifications_service_helper::remove_token(old_token) { eprintln!("Failed to un-register from independent push notifications service! {}", e); } }