Fixed muting so that it should be consistant. meaning, if a muted user leaves and comes back they should still be muted. Channel mute and unmute now specifically sets mute/unmute for each user so the whole channel is in deed muted or unmuted.

This commit is contained in:
Storm Dragon
2025-07-05 18:25:29 -04:00
parent d9c51c506c
commit 657ff1dbef
2 changed files with 20 additions and 8 deletions

View File

@ -142,9 +142,12 @@ func (b *Barnard) OnUserChange(e *gumble.UserChangeEvent) {
// 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 the channel is muted, ensure the user is muted
if b.MutedChannels[e.User.Channel.ID] {
b.UserConfig.ToggleMute(e.User)
// Only mute if not already muted
if !e.User.LocallyMuted {
b.UserConfig.ToggleMute(e.User)
}
if e.User.AudioSource != nil {
e.User.AudioSource.SetGain(0)
}