mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 05:26:59 +00:00
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
|
||||
process_message_delay_limit = 5
|
||||
|
||||
[features.legal_links]
|
||||
# URLs for legal documents
|
||||
terms_of_service = ""
|
||||
privacy_policy = ""
|
||||
guidelines = ""
|
||||
|
||||
[sentry]
|
||||
# Configuration for Sentry error reporting
|
||||
api = ""
|
||||
|
||||
@@ -382,6 +382,16 @@ pub struct FeaturesLimitsCollection {
|
||||
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)]
|
||||
pub struct FeaturesAdvanced {
|
||||
#[serde(default)]
|
||||
@@ -399,6 +409,7 @@ impl Default for FeaturesAdvanced {
|
||||
#[derive(Deserialize, Debug, Clone)]
|
||||
pub struct Features {
|
||||
pub limits: FeaturesLimitsCollection,
|
||||
pub legal_links: LegalLinks,
|
||||
pub webhooks_enabled: bool,
|
||||
pub mass_mentions_send_notifications: bool,
|
||||
pub mass_mentions_enabled: bool,
|
||||
|
||||
@@ -57,6 +57,8 @@ pub struct RevoltFeatures {
|
||||
pub livekit: VoiceFeature,
|
||||
/// Limits
|
||||
pub limits: LimitsConfig,
|
||||
/// Legal links
|
||||
pub legal_links: LegalLinks,
|
||||
}
|
||||
|
||||
/// # Limits For Users
|
||||
@@ -70,6 +72,17 @@ pub struct LimitsConfig {
|
||||
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
|
||||
#[derive(Serialize, JsonSchema, Debug)]
|
||||
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),
|
||||
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,
|
||||
app: config.hosts.app,
|
||||
|
||||
Reference in New Issue
Block a user