call_settings.rs

 1use anyhow::Result;
 2use gpui::App;
 3use schemars::JsonSchema;
 4use serde::{Deserialize, Serialize};
 5use settings::{Settings, SettingsKey, SettingsSources, SettingsUi};
 6
 7#[derive(Deserialize, Debug)]
 8pub struct CallSettings {
 9    pub mute_on_join: bool,
10    pub share_on_join: bool,
11}
12
13/// Configuration of voice calls in Zed.
14#[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug, SettingsUi, SettingsKey)]
15#[settings_key(key = "calls")]
16pub struct CallSettingsContent {
17    /// Whether the microphone should be muted when joining a channel or a call.
18    ///
19    /// Default: false
20    pub mute_on_join: Option<bool>,
21
22    /// Whether your current project should be shared when joining an empty channel.
23    ///
24    /// Default: false
25    pub share_on_join: Option<bool>,
26}
27
28impl Settings for CallSettings {
29    type FileContent = CallSettingsContent;
30
31    fn load(sources: SettingsSources<Self::FileContent>, _: &mut App) -> Result<Self> {
32        sources.json_merge()
33    }
34
35    fn import_from_vscode(_vscode: &settings::VsCodeSettings, _current: &mut Self::FileContent) {}
36}