mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-11-26 07:19:22 +00:00
Give full independent push service URL
This commit is contained in:
parent
5d63cd8945
commit
9c1675235c
@ -35,7 +35,7 @@ independent-push-service:
|
|||||||
control-token: BADTOKENTOCHANGE
|
control-token: BADTOKENTOCHANGE
|
||||||
|
|
||||||
# Public access URL pattern (for clients access) {TOKEN_URL} will be replaced by client token
|
# Public access URL pattern (for clients access) {TOKEN_URL} will be replaced by client token
|
||||||
public-url: http://localhost:4500/ws/{TOKEN_URL}
|
public-url: ws://localhost:4500/ws/{TOKEN_URL}
|
||||||
|
|
||||||
|
|
||||||
# Database configuration
|
# Database configuration
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use crate::data::config::conf;
|
||||||
use crate::data::user_token::PushNotificationToken;
|
use crate::data::user_token::PushNotificationToken;
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
pub struct PushNotificationsStatusAPI {
|
pub struct PushNotificationsStatusAPI {
|
||||||
pub status: String,
|
pub status: String,
|
||||||
pub independent_push_token: Option<String>,
|
pub independent_push_url: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PushNotificationsStatusAPI {
|
impl PushNotificationsStatusAPI {
|
||||||
@ -20,8 +21,9 @@ impl PushNotificationsStatusAPI {
|
|||||||
PushNotificationToken::FIREBASE(_) => "firebase",
|
PushNotificationToken::FIREBASE(_) => "firebase",
|
||||||
}.to_string(),
|
}.to_string(),
|
||||||
|
|
||||||
independent_push_token: match t {
|
independent_push_url: match (t, &conf().independent_push_service) {
|
||||||
PushNotificationToken::INDEPENDENT(i) => Some(i.to_string()),
|
(PushNotificationToken::INDEPENDENT(i), Some(conf)) =>
|
||||||
|
Some(conf.public_url.replace("{TOKEN_URL}", i)),
|
||||||
_ => None,
|
_ => None,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user