Updated how mute and deafen for self works, more similar to official client behavior.
This commit is contained in:
+22
-6
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user