Report configuration persistence failures

This commit is contained in:
Brandon McGinty (chatgpt)
2026-08-10 11:25:08 -04:00
committed by Brandon McGinty
parent 655a109ce8
commit ef8a92149d
3 changed files with 27 additions and 12 deletions
+7 -4
View File
@@ -58,6 +58,9 @@ func (c *Config) SaveConfig() error {
}
func (c *Config) saveConfigLocked() error {
if err := os.MkdirAll(filepath.Dir(c.fn), 0700); err != nil {
return err
}
data, err := toml.Marshal(c.config)
if err != nil {
return err
@@ -286,13 +289,13 @@ func (c *Config) findUser(address string, username string) *eUser {
return t
}
func (c *Config) ToggleMute(u *gumble.User) {
func (c *Config) ToggleMute(u *gumble.User) error {
c.mu.Lock()
defer c.mu.Unlock()
j := c.findUser(u.GetClient().Config.Address, u.Name)
j.LocallyMuted = !j.LocallyMuted
u.SetLocallyMuted(j.LocallyMuted)
_ = c.saveConfigLocked()
return c.saveConfigLocked()
}
func (c *Config) SetMicVolume(v float32) {
@@ -355,11 +358,11 @@ func (c *Config) GetNoiseSuppressionEnabled() bool {
return *c.config.NoiseSuppressionEnabled
}
func (c *Config) SetNoiseSuppressionEnabled(enabled bool) {
func (c *Config) SetNoiseSuppressionEnabled(enabled bool) error {
c.mu.Lock()
defer c.mu.Unlock()
c.config.NoiseSuppressionEnabled = &enabled
_ = c.saveConfigLocked()
return c.saveConfigLocked()
}
func (c *Config) GetRecordingFormat() string {