From 8c62babd48b36fe07eefc2a03f6f6c32646cb75b Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 29 Jan 2025 00:51:13 -0500 Subject: [PATCH] Make sure channels are initialized to unmuted when you join. --- client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 09884e6..3ed58d0 100644 --- a/client.go +++ b/client.go @@ -56,6 +56,9 @@ func (b *Barnard) connect(reconnect bool) bool { func (b *Barnard) OnConnect(e *gumble.ConnectEvent) { b.Client = e.Client + // Reset muted channels state on connect + b.MutedChannels = make(map[uint32]bool) + b.Ui.SetActive(uiViewInput) b.UiTree.Rebuild() b.Ui.Refresh() @@ -137,7 +140,7 @@ func (b *Barnard) OnUserChange(e *gumble.UserChangeEvent) { if e.User != nil { b.UserConfig.UpdateUser(e.User) - // New code: Check if user is joining a muted channel + // Check if user is joining a muted channel if e.Type.Has(gumble.UserChangeConnected) || e.Type.Has(gumble.UserChangeChannel) { // If the channel is muted, mute the new user if b.MutedChannels[e.User.Channel.ID] {