Synchronize connection-owned stream access

This commit is contained in:
Brandon McGinty (chatgpt)
2026-08-10 11:25:08 -04:00
committed by Brandon McGinty
parent f0aa5ff35a
commit e9ba7f580a
6 changed files with 133 additions and 84 deletions
+5 -5
View File
@@ -47,7 +47,7 @@ func (b *Barnard) exitWithError(err error) {
func (b *Barnard) connect(reconnect bool) bool {
var err error
_, err = gumble.DialWithDialer(new(net.Dialer), b.Config, &b.TLSConfig)
_, err = gumble.DialWithDialer(&net.Dialer{Timeout: 15 * time.Second}, b.Config, &b.TLSConfig)
if err != nil {
if reconnect {
b.Log(err.Error())
@@ -295,11 +295,11 @@ func (b *Barnard) OnUserChange(e *gumble.UserChangeEvent) {
if b.isChannelMuted(e.User.Channel.ID) {
// Only mute if not already muted
if !e.User.LocallyMuted() {
b.UserConfig.ToggleMute(e.User)
}
if b.Stream != nil {
b.Stream.UpdateUserGain(e.User)
if err := b.UserConfig.ToggleMute(e.User); err != nil {
b.AddOutputLine("Mute: could not save setting: " + err.Error())
}
}
b.updateUserGain(e.User)
}
}
}