Synchronize selected user access

This commit is contained in:
Brandon McGinty (chatgpt)
2026-08-10 00:42:09 -04:00
committed by Brandon McGinty
parent 20c6997ab0
commit 3efbd019ce
5 changed files with 49 additions and 21 deletions
+4 -4
View File
@@ -57,7 +57,7 @@ func (b *Barnard) Notify(event string, who string, what string) {
}
func (b *Barnard) SetSelectedUser(user *gumble.User) {
b.selectedUser = user
b.setSelectedUserValue(user)
if user == nil {
if len(b.UiInput.Text) > 0 {
}
@@ -493,9 +493,9 @@ func (b *Barnard) OnTextInput(ui *uiterm.Ui, textbox *uiterm.Textbox, text strin
// Not a command, send as chat message
if b.Client != nil && b.Client.Self != nil {
if b.selectedUser != nil {
b.selectedUser.Send(text)
b.AddOutputPrivateMessage(b.Client.Self, b.selectedUser, text)
if selectedUser := b.selectedUserValue(); selectedUser != nil {
selectedUser.Send(text)
b.AddOutputPrivateMessage(b.Client.Self, selectedUser, text)
} else {
b.Client.Self.Channel.Send(text, false)
b.AddOutputMessage(b.Client.Self, text)