Updated how mute and deafen for self works, more similar to official client behavior.

This commit is contained in:
Storm Dragon
2026-09-05 22:11:03 -04:00
parent cf9746c8de
commit 97e0dc9281
5 changed files with 111 additions and 23 deletions
+22 -6
View File
@@ -32,12 +32,13 @@ type Barnard struct {
Address string
TLSConfig tls.Config
Stream *gumbleopenal.Stream
connectionMutex sync.RWMutex
Tx bool
AutoTransmit bool // auto-start transmission on connect
Connected bool
stateMutex sync.RWMutex
Stream *gumbleopenal.Stream
connectionMutex sync.RWMutex
Tx bool
AutoTransmit bool // auto-start transmission on connect
Connected bool
unmuteOnUndeafen bool
stateMutex sync.RWMutex
Ui *uiterm.Ui
UiOutput uiterm.Textview
@@ -213,6 +214,21 @@ func (b *Barnard) isConnected() bool {
func (b *Barnard) setConnected(connected bool) {
b.stateMutex.Lock()
b.Connected = connected
if !connected {
b.unmuteOnUndeafen = false
}
b.stateMutex.Unlock()
}
func (b *Barnard) shouldUnmuteOnUndeafen() bool {
b.stateMutex.RLock()
defer b.stateMutex.RUnlock()
return b.unmuteOnUndeafen
}
func (b *Barnard) setUnmuteOnUndeafen(unmute bool) {
b.stateMutex.Lock()
b.unmuteOnUndeafen = unmute
b.stateMutex.Unlock()
}