call_settings.rs

 1use schemars::JsonSchema;
 2use serde_derive::{Deserialize, Serialize};
 3use settings::Setting;
 4
 5#[derive(Deserialize, Debug)]
 6pub struct CallSettings {
 7    pub mute_on_join: bool,
 8}
 9
10#[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug)]
11pub struct CallSettingsContent {
12    pub mute_on_join: Option<bool>,
13}
14
15impl Setting for CallSettings {
16    const KEY: Option<&'static str> = Some("calls");
17
18    type FileContent = CallSettingsContent;
19
20    fn load(
21        default_value: &Self::FileContent,
22        user_values: &[&Self::FileContent],
23        _: &gpui::AppContext,
24    ) -> anyhow::Result<Self> {
25        Self::load_via_json_merge(default_value, user_values)
26    }
27}