forked from jmug/stoatchat
feat: add legal links to root payload (#733)
Signed-off-by: ispik <ispik@ispik.dev>
This commit is contained in:
@@ -317,6 +317,12 @@ emojis = 500_000
|
|||||||
# default: 5
|
# default: 5
|
||||||
process_message_delay_limit = 5
|
process_message_delay_limit = 5
|
||||||
|
|
||||||
|
[features.legal_links]
|
||||||
|
# URLs for legal documents
|
||||||
|
terms_of_service = ""
|
||||||
|
privacy_policy = ""
|
||||||
|
guidelines = ""
|
||||||
|
|
||||||
[sentry]
|
[sentry]
|
||||||
# Configuration for Sentry error reporting
|
# Configuration for Sentry error reporting
|
||||||
api = ""
|
api = ""
|
||||||
|
|||||||
@@ -382,6 +382,16 @@ pub struct FeaturesLimitsCollection {
|
|||||||
pub roles: HashMap<String, FeaturesLimits>,
|
pub roles: HashMap<String, FeaturesLimits>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
|
pub struct LegalLinks {
|
||||||
|
/// Terms of Service URL
|
||||||
|
pub terms_of_service: String,
|
||||||
|
/// Privacy Policy URL
|
||||||
|
pub privacy_policy: String,
|
||||||
|
/// Guidelines URL
|
||||||
|
pub guidelines: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
pub struct FeaturesAdvanced {
|
pub struct FeaturesAdvanced {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
@@ -399,6 +409,7 @@ impl Default for FeaturesAdvanced {
|
|||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
pub struct Features {
|
pub struct Features {
|
||||||
pub limits: FeaturesLimitsCollection,
|
pub limits: FeaturesLimitsCollection,
|
||||||
|
pub legal_links: LegalLinks,
|
||||||
pub webhooks_enabled: bool,
|
pub webhooks_enabled: bool,
|
||||||
pub mass_mentions_send_notifications: bool,
|
pub mass_mentions_send_notifications: bool,
|
||||||
pub mass_mentions_enabled: bool,
|
pub mass_mentions_enabled: bool,
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ pub struct RevoltFeatures {
|
|||||||
pub livekit: VoiceFeature,
|
pub livekit: VoiceFeature,
|
||||||
/// Limits
|
/// Limits
|
||||||
pub limits: LimitsConfig,
|
pub limits: LimitsConfig,
|
||||||
|
/// Legal links
|
||||||
|
pub legal_links: LegalLinks,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// # Limits For Users
|
/// # Limits For Users
|
||||||
@@ -70,6 +72,17 @@ pub struct LimitsConfig {
|
|||||||
pub default: UserLimits,
|
pub default: UserLimits,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// # Legal links
|
||||||
|
#[derive(Serialize, JsonSchema, Debug)]
|
||||||
|
pub struct LegalLinks {
|
||||||
|
/// Terms of Service URL
|
||||||
|
pub terms_of_service: String,
|
||||||
|
/// Privacy Policy URL
|
||||||
|
pub privacy_policy: String,
|
||||||
|
/// Guidelines URL
|
||||||
|
pub guidelines: String,
|
||||||
|
}
|
||||||
|
|
||||||
/// # Global limits
|
/// # Global limits
|
||||||
#[derive(Serialize, JsonSchema, Debug)]
|
#[derive(Serialize, JsonSchema, Debug)]
|
||||||
pub struct GlobalLimits {
|
pub struct GlobalLimits {
|
||||||
@@ -238,6 +251,11 @@ pub async fn root() -> Result<Json<RevoltConfig>> {
|
|||||||
new_user: UserLimits::from_feature_limits(config.features.limits.new_user),
|
new_user: UserLimits::from_feature_limits(config.features.limits.new_user),
|
||||||
default: UserLimits::from_feature_limits(config.features.limits.default),
|
default: UserLimits::from_feature_limits(config.features.limits.default),
|
||||||
},
|
},
|
||||||
|
legal_links: LegalLinks {
|
||||||
|
terms_of_service: config.features.legal_links.terms_of_service,
|
||||||
|
privacy_policy: config.features.legal_links.privacy_policy,
|
||||||
|
guidelines: config.features.legal_links.guidelines,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
ws: config.hosts.events,
|
ws: config.hosts.events,
|
||||||
app: config.hosts.app,
|
app: config.hosts.app,
|
||||||
|
|||||||
Reference in New Issue
Block a user