mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-21 00:45:18 +00:00
Can get the list of Forez groups
This commit is contained in:
@ -2,6 +2,8 @@ use std::error::Error;
|
||||
|
||||
use yaml_rust::{Yaml, YamlLoader};
|
||||
|
||||
use crate::data::group_id::GroupID;
|
||||
|
||||
/// Server configuration
|
||||
///
|
||||
/// @author Pierre Hubert
|
||||
@ -47,6 +49,7 @@ pub struct Config {
|
||||
pub independent_push_service: Option<IndependentPushService>,
|
||||
pub database: DatabaseConfig,
|
||||
pub rtc_relay: Option<RtcRelayConfig>,
|
||||
pub forez_groups: Vec<GroupID>,
|
||||
}
|
||||
|
||||
/// Globally available configuration
|
||||
@ -143,6 +146,13 @@ impl Config {
|
||||
database: database_conf,
|
||||
|
||||
rtc_relay: rtc_config,
|
||||
|
||||
forez_groups: parsed["forez_groups"]
|
||||
.as_vec()
|
||||
.unwrap_or(&vec![])
|
||||
.iter()
|
||||
.map(|f| GroupID::new(f.as_i64().unwrap() as u64))
|
||||
.collect(),
|
||||
};
|
||||
|
||||
// Save new configuration in memory
|
||||
|
Reference in New Issue
Block a user